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

/* Light theme (default) */
:root[data-theme="light"] {
    --bg-color: #f4f4f4;
    --card-bg: #fff;
    --text-color: #333;
    --test-content-bg: #f8f9fa;
    --shadow-color: rgba(0,0,0,0.1);
}

/* Dark theme */
:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #ffffff;
    --test-content-bg: #363636;
    --shadow-color: rgba(0,0,0,0.3);
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    width: 100%;
    padding: 0;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: var(--card-bg);
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 30px;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
}

.theme-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-icon {
    font-size: 16px;
}

.theme-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* Section styles */
.section {
    background: var(--card-bg);
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 20px;
    width: 100%;
    border-radius: 8px;
    overflow-y: auto; /* Enable vertical scrolling */
    max-height: calc(100vh - 150px); /* Set max height relative to viewport */
}

.section h2 {
    padding: 20px 40px;
    margin: 0;
    color: var(--text-color);
    font-size: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
    background: var(--card-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.section h2:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.section.active {
    flex: 1;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    max-height: 800px; /* Add max height to enable scrolling */
}

.section:not(.active) {
    max-height: 65px;
}

.section:not(.active) .content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* Custom scrollbar for sections */
.section .content::-webkit-scrollbar {
    width: 8px;
}

.section .content::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.section .content::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border-radius: 4px;
}

.section .content::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.6);
}

.number-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.section.active .toggle-icon {
    transform: rotate(180deg);
}

.section .content {
    padding: 20px 40px;
    overflow-y: auto;
    max-height: 600px;
}

/* Custom scrollbar for content */
.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.6);
}

.section.active .content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 40px;
}

/* Add custom scrollbar styling for the main section content */
.section.active::-webkit-scrollbar {
    width: 8px;
}

.section.active::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.section.active::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border-radius: 4px;
}

.section.active::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.6);
}

.test-content {
    padding: 20px;
    background: var(--test-content-bg);
    border-radius: 4px;
    margin: 20px 0;
    min-height: 1000px; /* This is just to ensure we have scrollable content */
}

.section-1 { 
    border-left: 5px solid #3498db; 
}
.section-1 .number-icon {
    background-color: #3498db;
}
.section-2 { 
    border-left: 5px solid #2ecc71; 
}
.section-2 .number-icon {
    background-color: #2ecc71;
}
.section-3 { 
    border-left: 5px solid #9b59b6; 
}
.section-3 .number-icon {
    background-color: #9b59b6;
}

/* Section 1 specific styles */
.section-1 .flex-container {
    display: flex;
    gap: 30px;
    height: 100%;
    overflow-y: auto;
    max-height: 600px;
}

/* Custom scrollbar for Section 1 flex-container */
.section-1 .flex-container::-webkit-scrollbar {
    width: 8px;
}

.section-1 .flex-container::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.section-1 .flex-container::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border-radius: 4px;
}

.section-1 .flex-container::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.6);
}

/* Reset general flex-container styles */
.flex-container {
    display: flex;
    gap: 30px;
}

.left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.upload-area {
    background: var(--test-content-bg);
    border-radius: 8px;
    padding: 20px;
}

.stats-area {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    overflow-y: auto;
}

.file-list-area {
    display: flex;
    flex-direction: column;
    background: var(--test-content-bg);
    border-radius: 8px;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.file-list-header {
    margin-bottom: 10px;
}

.file-list-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.file-list-title {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: var(--test-content-bg);
    border-radius: 4px;
    margin-bottom: 10px;
}

.file-list-title h3 {
    color: var(--text-color);
    margin: 0;
    font-size: 18px;
    position: sticky;
    top: 0;
    background: var(--test-content-bg);
    padding: 5px 0;
    z-index: 5;
}

/* Add scrollbar styling for file list title */
.file-list-title::-webkit-scrollbar {
    width: 8px;
}

.file-list-title::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.file-list-title::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.3);
    border-radius: 4px;
}

.file-list-title::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.5);
}

.file-count {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9em;
    padding: 5px 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
}

#matchingFileCount {
    color: #3498db;
    font-weight: bold;
}

.file-list-container {
    margin-top: 10px;
    max-height: 300px;
    min-height: 100px;
    overflow-y: auto;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 4px;
    background: var(--card-bg);
    padding: 10px;
}

/* Custom scrollbars */
.section .content::-webkit-scrollbar,
.file-list-container::-webkit-scrollbar {
    width: 8px;
}

.section .content::-webkit-scrollbar-track,
.file-list-container::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.section .content::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border-radius: 4px;
}

.section .content::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.6);
}

.file-list-container::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.3);
    border-radius: 4px;
}

.file-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.5);
}

.no-files-message {
    text-align: center;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.8;
    padding: 20px;
}

.file-list {
    display: flex;
    flex-direction: column;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    transition: background-color 0.2s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: rgba(52, 152, 219, 0.1);
}

.file-icon {
    margin-right: 10px;
    font-size: 16px;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-color);
}

.file-size {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9em;
    margin-left: 10px;
}

.file-drop-area.highlight {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.file-drop-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
    margin-bottom: 20px;
    background: var(--card-bg);
}

.file-drop-area:hover {
    border-color: #2980b9;
}

.file-drop-area input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.upload-btn, .download-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.upload-btn:hover, .download-btn:hover {
    background: #2980b9;
}

.stats-content {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.no-stats-message {
    text-align: center;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.8;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.stat-item:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.stat-label {
    color: var(--text-color);
    opacity: 0.8;
}

.stat-value {
    font-weight: bold;
    color: #3498db;
}

.download-btn {
    margin-top: auto;
}

.delete-file {
    background: none;
    border: none;
    color: var(--text-color);
    opacity: 0.5;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    margin-left: 10px;
    line-height: 1;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.delete-file:hover {
    opacity: 1;
    color: #e74c3c;
}

/* Update responsive design for section 1 */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .section h2 {
        padding: 15px 20px;
        font-size: 18px;
    }
    
    .content {
        padding: 0 20px;
    }
    
    .number-icon {
        width: 25px;
        height: 25px;
        margin-right: 10px;
    }
    
    .test-content {
        padding: 15px;
    }

    .flex-container {
        flex-direction: column;
        gap: 20px;
    }

    .left-column {
        width: 100%;
    }

    .stats-area {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .upload-area, .stats-area, .file-list-area {
        width: 100%;
    }

    .file-list-container {
        max-height: 200px;
    }

    .file-drop-area {
        padding: 20px;
    }

    .upload-icon {
        font-size: 36px;
    }

    .file-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .file-count {
        width: 100%;
        text-align: center;
    }
}

.selected-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.clear-all-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-all-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.clear-all-btn:active {
    transform: scale(0.95);
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 8px;
    margin-bottom: 10px;
    min-width: 300px;
    max-width: 500px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.3s ease-out forwards;
    transition: all 0.3s ease;
}

.toast.success {
    border-left: 4px solid #4CAF50;
    background-color: var(--card-bg);
}

.toast.error {
    border-left: 4px solid #f44336;
    background-color: var(--card-bg);
}

.toast.info {
    border-left: 4px solid #2196F3;
    background-color: var(--card-bg);
}

.toast-content {
    flex-grow: 1;
    margin-right: 12px;
    color: var(--text-color);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0 4px;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Password Control Styles */
.password-control {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-label {
    color: var(--text-color);
    font-size: 14px;
}

.password-input-container {
    position: relative;
    width: 100%;
}

.eye-icon {
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.toggle-password:hover {
    opacity: 1;
}

.password-input,
.individual-password {
    width: 100%;
    padding: 8px 12px;
    padding-right: 32px;  /* Make room for the icon */
}

.password-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.password-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.password-input::placeholder {
    color: var(--text-muted);
}

.individual-password {
    padding: 4px 8px;
    padding-right: 35px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 0 10px;
    width: 150px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 14px;
}

.individual-password:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.individual-password::placeholder {
    color: var(--text-muted);
}

.file-item .password-input-container {
    margin: 0 10px;
    flex: 0 0 auto;
    width: auto;
}

/* Dark mode adjustments */
:root[data-theme="dark"] .toggle-password {
    color: var(--text-color);
    opacity: 0.8;
}

:root[data-theme="dark"] .toggle-password:hover {
    opacity: 1;
}

.section-2 .file-drop-area {
    border: 2px dashed #2ecc71;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
    margin-bottom: 20px;
    background: var(--card-bg);
}

.section-2 .file-drop-area:hover {
    border-color: #27ae60;
}

.section-2 .file-drop-area.highlight {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.section-2 .upload-btn, 
.section-2 .download-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.section-2 .upload-btn:hover,
.section-2 .download-btn:hover {
    background: #27ae60;
}

/* Section 2 specific styles */
.section-2 .flex-container {
    display: flex;
    gap: 30px;
    height: 100%;
    overflow-y: auto;
    max-height: 600px;
}

/* Custom scrollbar for Section 2 flex-container */
.section-2 .flex-container::-webkit-scrollbar {
    width: 8px;
}

.section-2 .flex-container::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.section-2 .flex-container::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.4);
    border-radius: 4px;
}

.section-2 .flex-container::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 204, 113, 0.6);
}

/* Custom scrollbar for Section 2 file list title */
.section-2 .file-list-title::-webkit-scrollbar {
    width: 8px;
}

.section-2 .file-list-title::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.section-2 .file-list-title::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.3);
    border-radius: 4px;
}

.section-2 .file-list-title::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 204, 113, 0.5);
}

/* Custom scrollbar for Section 2 file list container */
.section-2 .file-list-container::-webkit-scrollbar {
    width: 8px;
}

.section-2 .file-list-container::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.section-2 .file-list-container::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.3);
    border-radius: 4px;
}

.section-2 .file-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 204, 113, 0.5);
}

/* Custom scrollbar for Section 2 content */
.section-2 .content::-webkit-scrollbar {
    width: 8px;
}

.section-2 .content::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.section-2 .content::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.4);
    border-radius: 4px;
}

.section-2 .content::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 204, 113, 0.6);
} 