* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background: #202020;
    color: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0c0c0c; /* rgb(12,12,12) */
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

/* Header */
.header {
    background: #171717; /* rgb(23,23,23) */
    border-bottom: 1px solid #202020;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.nav-bar {
    display: flex;
    gap: 20px;
    align-items: center;
}


/* Download Tool Button */
.btn-download-tool {
    background: #141414; /* rgb(20,20,20) */
    color: #ffffff;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
}

.btn-download-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    background: #202020;
}

.btn-download-tool:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.content-panel {
    background: #141414; /* rgb(20,20,20) */
    border: 1px solid #202020;
    border-radius: 8px;
    padding: 30px;
}

.panel-title {
    font-size: 28px;
    margin-bottom: 10px;
    color: #ffffff;
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 2px dashed #303030;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #171717; /* rgb(23,23,23) */
}

.upload-area:hover {
    border-color: #ffffff;
    background: #202020;
}

.upload-area.dragover {
    border-color: #ffffff;
    background: #141414;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.upload-text strong {
    font-size: 18px;
    color: #ffffff;
}

.upload-text span {
    font-size: 14px;
    color: #888;
}

.upload-info {
    margin-top: 15px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.highlight {
    color: #e5e5e5;
}

/* Messages */
#messageArea {
    margin-bottom: 30px;
}

.message {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.message-success {
    background: #121212;
    border-left: 3px solid #e5e5e5;
    color: #e5e5e5;
}

.message-error {
    background: #4d1a1a;
    border-left: 3px solid #ff4444;
    color: #ff4444;
}

.message-info {
    background: #121212;
    border-left: 3px solid #9ca3af;
    color: #d1d5db;
}

/* Files Section */
.files-section {
    margin-top: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.section-header h2 {
    font-size: 20px;
    color: #ffffff;
}

.btn-refresh {
    background: #141414;
    color: #ffffff;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background: #202020;
}

.btn-download-all {
    background: #141414;
    color: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5), 0 0 12px rgba(255, 255, 255, 0.3);
}

.btn-download-all:hover {
    background: #202020;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.8);
}

.btn-clear-cache {
    background: #141414;
    color: #ffffff;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-clear-cache:hover {
    background: #202020;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
}

.tab-btn {
    background: none;
    border: none;
    color: #888;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

.upload-area.sound-mode {
    border-color: #2a3a4a;
}

.upload-area.sound-mode.dragover {
    border-color: #4a6a8a;
    background: #121820;
}

.files-container {
    min-height: 200px;
}

.loading, .empty-state, .error-state {
    text-align: center;
    padding: 40px;
    color: #888;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    background: #171717; /* rgb(23,23,23) */
    border: 1px solid #202020;
    border-radius: 6px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.file-item:hover {
    background: #141414;
}

.file-info {
    flex: 1;
}

.file-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.file-name {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 5px;
    word-break: break-all;
}

.file-meta {
    color: #888;
    font-size: 12px;
}

.btn-copy {
    background: #141414;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-copy:hover {
    background: #202020;
}

.btn-download {
    background: #141414;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-download:hover {
    background: #202020;
}

.btn-delete {
    background: #141414;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-delete:hover {
    background: #202020;
}

.btn-view {
    background: #141414;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-view:hover {
    background: #202020;
}

/* Cache Modal */
.cache-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.cache-modal-content {
    background: #252525;
    border: 1px solid #444;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.cache-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.cache-modal-header h3 {
    color: #ffffff;
    font-size: 18px;
    margin: 0;
}

.cache-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.cache-modal-close:hover {
    background: #333;
    color: #ffffff;
}

.cache-modal-body {
    padding: 20px;
    flex: 1;
    overflow: auto;
}

.cache-textarea {
    width: 100%;
    min-height: 300px;
    max-height: 60vh;
    background: #1f1f1f;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 15px;
    resize: vertical;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.cache-textarea:focus {
    outline: none;
    border-color: #ffffff;
}

.cache-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #333;
}

.btn-copy-modal {
    background: #141414;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy-modal:hover {
    background: #202020;
}

.btn-close-modal {
    background: #333;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid #444;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close-modal:hover {
    background: #202020;
}

/* New Modal Styles */
.private-access-modal, .confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.private-access-modal-content, .confirmation-modal-content {
    background: #141414; /* Same as content-panel */
    border: 1px solid #202020;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-height: 90vh; /* Ensure it doesn't overflow on smaller screens */
    overflow-y: auto; /* Allow scrolling if content is too long */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    color: #ffffff;
    font-size: 20px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #202020;
    color: #ffffff;
}

.modal-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-body p {
    color: #aaaaaa;
    font-size: 14px;
}

.modal-body a {
    color: #ffffff;
    text-decoration: underline;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px;
    background: #0c0c0c;
    border: 1px solid #202020;
    border-radius: 4px;
    color: #ffffff;
    font-size: 14px;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #e5e5e5;
}

.message-area {
    min-height: 20px; /* Reserve space for messages */
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #141414;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #202020;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #333;
}

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    background: #111;
}

.consent-row input[type="checkbox"] {
    margin-top: 4px;
}

.consent-row label {
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.4;
}

#dmNotifyButton {
    width: auto;
    min-width: 160px;
    padding: 10px 16px;
    font-size: 14px;
}

#dmNotifyButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #171717;
    color: #ffffff;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #202020;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav-bar {
        flex-wrap: wrap;
        justify-content: center;
    }

    .content-panel {
        padding: 20px;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-copy,
    .btn-download,
    .btn-delete {
        width: 100%;
        text-align: center;
    }

    .private-access-modal-content, .confirmation-modal-content {
        max-width: 95%;
    }
}
