* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* GitHub Link */
.github-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
    z-index: 100;
}

.github-link:hover {
    color: #fff;
}

/* Account Dropdown */
.account-dropdown {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #fff;
    padding: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.account-btn:hover {
    opacity: 0.8;
}

.account-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.account-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    transition: transform 0.2s;
}

.account-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    min-width: 120px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.account-dropdown.open .account-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.account-menu-item:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 550px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #fff;
    font-size: 1.8rem;
}

.title-moon {
    background: linear-gradient(to right, #fadd9c, #c28458);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-sup {
    font-size: 0.75em;
    vertical-align: top;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

/* Login Section */
#loginSection {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#loginSection p {
    margin-bottom: 20px;
    color: #aaa;
}

/* Discord Button */
.discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #5865F2;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.discord-btn:hover {
    background: #4752c4;
}

.discord-btn:active {
    transform: scale(0.98);
}

.discord-btn svg {
    flex-shrink: 0;
}

/* Form Section */
#formSection {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    overflow: hidden;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: #fff;
    background: rgba(88, 101, 242, 0.1);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #5865F2;
}

.tab-content {
    padding: 30px;
}

.welcome-msg {
    text-align: center;
    margin-bottom: 10px;
    color: #aaa;
}

.welcome-msg span {
    color: #5865F2;
    font-weight: 600;
}

.logout-btn {
    display: block;
    margin: 0 auto 30px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Form */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #fff;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #5865F2;
}

.form-group input[type="text"]::placeholder {
    color: #666;
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: #1a1a2e;
    color: #fff;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #aaa;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-group input[type="file"]:hover {
    border-color: #5865F2;
}

.form-group input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #5865F2, #7289da);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: opacity 0.2s;
}

.form-group input[type="file"]::file-selector-button:hover {
    opacity: 0.85;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 0.85rem;
}

/* Checkbox Group */
.checkbox-group {
    margin-top: 20px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    margin-bottom: 0;
    line-height: 1;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #5865F2;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
}

.checkbox-label span {
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
}

/* Folder Tree */
.folder-tree {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px;
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(88, 101, 242, 0.5) rgba(0, 0, 0, 0.2);
}

.folder-tree::-webkit-scrollbar {
    width: 8px;
}

.folder-tree::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.folder-tree::-webkit-scrollbar-thumb {
    background: rgba(88, 101, 242, 0.5);
    border-radius: 4px;
}

.folder-tree::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 101, 242, 0.7);
}

.folder-tree-loading {
    color: #888;
    font-style: italic;
}

.folder-tree-error {
    color: #e74c3c;
}

.folder-node {
    margin-left: 0;
}

.folder-node .folder-children {
    margin-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 8px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    color: #ccc;
}

.folder-item:hover {
    background: rgba(88, 101, 242, 0.2);
    color: #fff;
}

.folder-item.selected {
    background: rgba(88, 101, 242, 0.4);
    color: #fff;
    border: 1px solid #5865F2;
}

.folder-item .folder-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.folder-item .folder-name {
    font-size: 0.95rem;
}

/* Folder Tooltips */
.folder-tooltip {
    position: fixed;
    padding: 8px 12px;
    background: #1a1a2e;
    border: 1px solid rgba(88, 101, 242, 0.4);
    border-radius: 6px;
    color: #ccc;
    font-size: 0.85rem;
    white-space: normal;
    max-width: 250px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.15s;
}

.folder-tooltip.visible {
    opacity: 1;
}


/* Image Preview */
#previewContainer {
    margin-bottom: 24px;
    text-align: center;
}

#previewContainer label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #fff;
}

#imagePreview {
    max-width: 128px;
    max-height: 128px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #5865F2, #7289da);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.submit-btn:hover {
    opacity: 0.9;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Section */
#statusSection {
    text-align: center;
}

/* Loading */
#loadingStatus {
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #5865F2;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Box */
.success-box {
    padding: 40px 20px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.success-box h2 {
    color: #2ecc71;
}

.success-box p {
    color: #aaa;
    margin-bottom: 20px;
}

.pr-link {
    display: inline-block;
    background: #2ecc71;
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 15px;
    transition: background 0.2s;
}

.pr-link:hover {
    background: #27ae60;
}

.success-box .submit-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 10px;
}

.success-box .submit-btn:hover {
    border-color: #5865F2;
    background: rgba(88, 101, 242, 0.1);
}

/* Notice Box */
.notice-box {
    padding: 16px;
    background: rgba(88, 101, 242, 0.2);
    border-radius: 0 8px 8px 0;
    border: none;
    border-left: 4px solid #5865F2;
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 20px;
}

.notice-box strong {
    color: #a8b4f0;
}

.notice-box a {
    color: #a8b4f0;
    text-decoration: none;
}

.notice-box a:hover {
    text-decoration: underline;
}

.notice-box ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.notice-box li {
    margin: 4px 0;
}

/* Error Box */
.error-box {
    padding: 40px 20px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.error-box h2 {
    color: #e74c3c;
}

.error-box p {
    color: #aaa;
    margin-bottom: 20px;
}

/* Not Member Section */
#notMemberSection .error-box {
    max-width: 400px;
    margin: 0 auto;
}

/* Confirmation Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    text-align: center;
    color: #fff;
    margin-bottom: 8px;
}

.modal-content > p {
    text-align: center;
    color: #aaa;
    margin-bottom: 24px;
}

.confirm-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-row:last-child {
    border-bottom: none;
}

.confirm-label {
    color: #888;
    font-size: 0.9rem;
}

.confirm-value {
    color: #fff;
    font-weight: 600;
}

.confirm-preview {
    padding-top: 15px;
    text-align: center;
}

.confirm-preview .confirm-label {
    display: block;
    margin-bottom: 12px;
}

.confirm-preview img {
    max-width: 96px;
    max-height: 96px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
}

.cancel-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.confirm-btn {
    background: linear-gradient(135deg, #5865F2, #7289da);
    color: white;
}

.confirm-btn:hover {
    opacity: 0.9;
}

/* Submissions Tab */
.submissions-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #888;
    padding: 20px;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #5865F2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.submissions-empty {
    color: #888;
    text-align: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(88, 101, 242, 0.5) rgba(0, 0, 0, 0.2);
}

.submissions-list::-webkit-scrollbar {
    width: 8px;
}

.submissions-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.submissions-list::-webkit-scrollbar-thumb {
    background: rgba(88, 101, 242, 0.5);
    border-radius: 4px;
}

.submissions-list::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 101, 242, 0.7);
}

.submission-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s;
}

.submission-card:hover {
    border-color: rgba(88, 101, 242, 0.4);
}

.submission-image {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submission-image img {
    max-width: 48px;
    max-height: 48px;
    border-radius: 6px;
}

.submission-image-denied {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.submission-image-denied svg {
    opacity: 0.6;
}

.submission-info {
    flex: 1;
    min-width: 0;
}

.submission-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.submission-name {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Submission status badges */
.submission-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.submission-status-open {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.submission-status-merged {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.submission-status-closed {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* Merged/closed submission card styling */
.submission-card.submission-merged,
.submission-card.submission-closed {
    opacity: 0.7;
}

.submission-card.submission-merged:hover,
.submission-card.submission-closed:hover {
    opacity: 0.85;
}

/* Submission status row (legacy) */
.submission-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.85rem;
}

.status-label {
    color: #888;
}

/* Check status indicators */
.check-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.check-success {
    color: #2ecc71;
}

.check-failure {
    color: #e74c3c;
}

.check-pending {
    color: #f1c40f;
    animation: pulse 1.5s ease-in-out infinite;
}

.check-none {
    color: #888;
}

.check-unknown {
    color: #888;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.submission-folder {
    color: #888;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.submission-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.submission-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.submission-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.submission-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.submission-btn.view-btn {
    background: rgba(88, 101, 242, 0.2);
    color: #7289da;
}

.submission-btn.view-btn:hover {
    background: rgba(88, 101, 242, 0.4);
}

.submission-btn.edit-btn {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.submission-btn.edit-btn:hover {
    background: rgba(46, 204, 113, 0.4);
}

.submission-btn.close-btn {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.submission-btn.close-btn:hover {
    background: rgba(231, 76, 60, 0.4);
}

/* Edit Modal */
.edit-modal-content {
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-modal-content .folder-tree {
    max-height: 180px;
}

.preview-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #fff;
}

#editPreviewContainer {
    margin-bottom: 20px;
    text-align: center;
}

#editImagePreview {
    max-width: 96px;
    max-height: 96px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
}

/* Danger Button */
.danger-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.danger-btn:hover {
    opacity: 0.9;
}

.danger-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: toastIn 0.3s ease-out;
    max-width: 400px;
    text-align: center;
}

.toast.toast-out {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-success {
    background: rgba(46, 204, 113, 0.95);
    color: #fff;
}

.toast-error {
    background: rgba(231, 76, 60, 0.95);
    color: #fff;
}

.toast-info {
    background: rgba(88, 101, 242, 0.95);
    color: #fff;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    #formSection {
        padding: 20px;
    }

    .submission-card {
        flex-wrap: wrap;
    }

    .submission-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }
}
