:root {
    /* colors */
    --white: #F9F9F9;
    --light-white: #EFEFEF;
    --light-black: #363636;
    --black: #000;
    --body-bgc: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #48bb78;
    --error: #f56565;
    --skipped: #ecc94b;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--body-bgc);
    min-height: 100vh;
    color: var(--black);
}

/* Navigation */
nav > ul > li > a:hover {
    color: var(--light-white)
}

/* Nav user avatar */
.nav-user-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 !important;
    text-decoration: none;
}

.nav-avatar-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.nav-avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.nav-user-name {
    font-size: 0.875rem;
    color: var(--white);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-signout-btn {
    font-size: 0.75rem;
    padding: 3px 10px;
    color: rgba(255,255,255,0.7) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    background: transparent !important;
    white-space: nowrap;
}

.nav-signout-btn:hover {
    color: #fff !important;
    border-color: rgba(255,255,255,0.5) !important;
    background: rgba(255,255,255,0.08) !important;
}

li.nav-item:hover {
    color: var(--light-white);
}

.navbar-nav > .nav-item > .nav-link, .navbar-nav > .nav-item > .nav-link:hover {
    color: var(--white) !important;
}


.navbar-nav-wrap {
    margin: 0 auto;
    padding: 1em;
    max-width: 700px;
    background-color: var(--light-black);
}

.navbar-expand-lg .navbar-nav .dropdown-menu {
    right: 0;
}

.navbar-expand-lg, .navbar-expand-xl, .navbar-collapse > .navbar-nav {
    background-color: var(--light-black);
}

.nav-link {
    padding: 0 0 1em 0;
}

.nav-logo > .nav-link {
    padding: 0;
}

.navbar-nav > .nav-item > .nav-link, .navbar-nav > .nav-item > .nav-link:hover {
    color: var(--white)
}

.nav-logo {
    color: var(--light-white);
}

.current-page {
    font-weight: bold;
    border-bottom: 2px solid var(--white);
}

.app {
    padding: .5rem;
}

@media screen and (min-width: 992px) {
    .navbar-nav-wrap {
        max-width: 700px;
    }

    .navbar-nav > .nav-item {
        padding: 0 0.75rem 0 0.75rem;
    }

    .navbar-nav > .nav-item > .nav-link {
        padding: 0 0 0.3em 0;
    }

    .navbar-nav > .nav-item.btn {
        padding: 0 .3em;
    }

    .navbar-expand-lg .nav-item:not(:last-child) {
        margin-right: 1rem;
    }

    .app {
        padding: 1.5rem;
    }
}

@media screen and (min-width: 1201px) {

    .navbar-nav-wrap {
        max-width: 1140px;
    }

    .navbar-nav-wrap {
        margin: 0 auto;
    }

    .navbar-expand-xl .nav-item:not(:last-child) {
        margin-right: 0;
    }
}

.container {
    max-width: 1300px;
}

header {
    text-align: center;
}

h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.tagline {
    color: #666;
    font-size: 1.1em;
}

/* Auth Section */
.auth-section {
    text-align: center;
    padding: 0;
}

.auth-section * {
    color: var(--light-white);
}

.info-box {
    margin: 3rem auto;
    max-width: 700px;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 15px;
}

.features {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 20px auto;
}

.features li {
    padding: 10px;
    font-size: 1.1em;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    padding: 1.2rem;
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.2em;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

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

.btn-compare {
    border: 1px solid var(--light-white);
    color: var(--light-white);
    transition: .3s;
}

.btn-compare:hover {
    border: 1px solid var(--success);
    color: var(--light-white);
}

.file-detail-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-compare-file {
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.55);
    background: transparent;
    font-size: 0.75em;
    padding: 2px 8px;
    transition: .2s;
    flex-shrink: 0;
}

.btn-compare-file:hover {
    border-color: rgba(255,255,255,0.6);
    color: white;
}

.compression-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.preset-label {
    font-size: 0.8em;
    color: rgba(255,255,255,0.6);
    margin-right: 2px;
}

.compression-select {
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.07);
    font-size: 0.82em;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}

.compression-select:hover {
    border-color: rgba(255,255,255,0.5);
}

.compression-select option {
    background: #1e1e2e;
    color: white;
}

.btn-recompress {
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    background: rgba(255,255,255,0.08);
    font-size: 0.85em;
    padding: 5px 14px;
    transition: .2s;
    margin-left: 4px;
}

.btn-recompress:hover {
    background: rgba(255,255,255,0.15);
    border-color: white;
    color: #fefefe;
    cursor: pointer;
}

.btn-recompress:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* User Info */
.user-info {
    margin-bottom: 30px;
    flex-wrap: wrap;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 10px;

    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media screen and (min-width: 768px) {
    .user-info {
        padding: 15px;
    }
}

/* Stats Section */
.stats-section {
    margin-bottom: 30px;
}

.stats-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--body-bgc);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Email List */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-header-left h3 {
    margin: 0;
}

.attachments-size-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex-wrap: wrap;
}

.size-badge {
    font-size: 0.85em;
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

.email-list {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: var(--body-bgc);

}

.email-item {
    display: flex;
    align-items: start;
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    /*background: var(--body-bgc);*/
    cursor: pointer;
}

.email-section {
    padding: .5em;
    border-radius: 10px;
}

@media screen and (min-width: 768px) {
    .email-section {
        padding: 1em;
    }
}

.pending-email-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.pending-email-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ✅ Visual checkbox indicator */
.email-checkbox-indicator {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    font-size: 16px;
    color: white;
    transition: all 0.2s;
}

.pending-email-item:hover .email-checkbox-indicator {
    border-color: rgba(255, 255, 255, 0.5);
}

.email-content {
    flex: 1;
}

.email-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 1em;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.bulk-actions {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    justify-content: center;
    max-width: 400px;
}

.bulk-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media screen and (min-width: 768px) {
    .email-item {
        padding: 20px;
    }

    .bulk-actions {
         justify-content: space-between;
    }
}

.email-item:hover {
    background: var(--light-black);
}

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

.email-item.selected {
    background: var(--light-black);
}

.email-checkbox {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.email-content {
    flex: 1;
}

.email-subject {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #333;
}

.email-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
}

.email-meta > .arrow {
    display: inline-block;
}

.attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #e2e8f0;
    border-radius: 6px;
    font-size: 0.85em;
    color: #4a5568;
}

.attachment-size {
    color: #667eea;
    font-weight: 600;
}

.savings-estimate {
    display: flex;
    align-items: center;
    gap: 12px;
}

.savings-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.savings-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.75);
}

.savings-estimate:hover .savings-tooltip {
    opacity: 1;
}

@media (max-width: 768px) {

    .savings-estimate {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* Compressed Emails Section */
.compressed-section {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    animation: slideDown 0.3s ease-out;
}

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

/* Compression Summary Cards */
.compression-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #4caf50;
}

/* Compressed Email Item */
.compressed-email-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.compressed-email-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.compressed-email-title {
    font-weight: 600;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
}

.compressed-email-meta {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

/* Compression Result Badge */
.compression-result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
    font-weight: 600;
    color: #4caf50;
}

.size-comparison {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

/* File Details List */
.file-details-list {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    display: block; /* Hidden by default, toggle with button */
}

.file-details-list.show {
    display: block;
}

.file-detail-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.file-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.file-compression {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
}

/* Actions */
.compressed-email-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.compressed-email-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
}

/* Controls */
.controls {
    margin: 2rem 0;
    justify-content: center;
}

.controls-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters-section {
    padding: 20px;
    color: var(--light-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.filters-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.filter-item label {
    margin-top: 1rem;
    font-size: 0.9em;
    font-weight: 600;
    /*color: #555;*/
}

.filter-select,
.filter-input {
    padding: .8rem;
    font-size: 1em;
    color: var(--light-white);
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    transition: border-color 0.2s ease;
}

.filter-select:hover,
.filter-input:hover {
    border-color: #667eea;
    cursor: pointer;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Search input styling */
.search-input {
    width: 100%;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.filter-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.filter-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Process Stepper */
.process-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 30px auto;
    max-width: 800px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

@media screen and (min-width: 768px){
    .process-stepper{
         display: flex;
    }
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.step-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    transition: all 0.3s ease;
    max-width: 120px;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Active step */
.step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.step.active .step-label {
    color: white;
    font-weight: 600;
}

/* Completed step */
.step.completed .step-number {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.step.completed .step-number::before {
    content: '✓';
    position: absolute;
    font-size: 20px;
}

.step.completed .step-label {
    color: rgba(255, 255, 255, 0.8);
}

/* Completed connector */
.step-connector.completed {
    background: #4caf50;
}

/* Responsive */
@media (max-width: 768px) {
    .process-stepper {
        flex-direction: column;
        gap: 20px;
    }

    .step-connector {
        width: 2px;
        height: 30px;
        flex: 0;
    }

    .step-label {
        max-width: 200px;
    }
}

/* Progress Section */
.progress-section {
    margin-top: 30px;
    padding: 30px;
    border-radius: 10px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#sendingSpinnerWrapper {
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.processing-txt {
    color: var(--light-white);
    font-size: 20px;
}

.dots {
    color: var(--light-white);
    display: inline-flex;
}

.dot {
    animation: blink 2s infinite both;
    display: inline-block;
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

.spinner-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.spinner-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 0;
}

.result-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.result-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin-top: 12px;
    border-radius: 4px;
}

.result-warning strong {
    color: #ff9800;
    display: block;
    margin-bottom: 8px;
}

.result-warning ul {
    margin: 0;
    padding-left: 20px;
}

.result-warning li {
    color: rgba(255, 255, 255, 0.9);
    margin: 4px 0;
}

.result-item.success {
    border-left: 4px solid var(--success);
}

.result-item.error {
    border-left: 4px solid var(--error);
}

.result-item.skipped {
    border-left: 4px solid var(--skipped);
    background: #fffbeb;
}

.result-subject {
    font-weight: 600;
    margin-bottom: 5px;
}

.result-stats {
    font-size: 0.9em;
    color: #666;
}

.result-error {
    color: var(--error);
    font-size: 0.9em;
}

.glassmorphism {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: var(--light-white);
}

.glassmorphism.highlight {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.glassmorphism.banner {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: start;
    }

    .attachments-size-row {
        flex-direction: column;
        gap: 2px;
    }

    .email-meta {
        gap: 5px;
    }

    .controls {
        flex-direction: column;
    }

    .controls .btn {
        width: 100%;
    }
}

/* Scrollbar styling */
.email-list::-webkit-scrollbar,
.progress-results::-webkit-scrollbar {
    width: 8px;
}

.email-list::-webkit-scrollbar-track,
.progress-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.email-list::-webkit-scrollbar-thumb,
.progress-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.email-list::-webkit-scrollbar-thumb:hover,
.progress-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.modal-body {
    padding: 25px;
}

.modal-message {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 20px;
}

.modal-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
}

.modal-info p {
    margin: 10px 0;
    color: #555;
}

.modal-info ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.modal-info li {
    padding: 8px 0;
    color: #666;
    font-size: 0.95em;
}

.modal-warning {
    color: var(--error) !important;
    font-weight: 600;
    margin-top: 15px !important;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

.modal {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
}

.modal[style*="display: flex"] {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Success screen action buttons */
.success-actions {
    position: relative;
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.success-actions .btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 8px;
    box-sizing: border-box;
}

.success-actions .btn-primary:hover {
    background: #667eea;
    transform: none;
    box-shadow: none;
}

.success-actions .btn-secondary:hover {
    background: #e2e8f0;
    color: #4a5568;
}

.process-selected-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.accept-batch-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

@media (max-width: 576px) {
    .process-selected-wrapper,
    .accept-batch-wrapper {
        justify-content: center;
    }
}

/* Reclaim confirmation popup */
.reclaim-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.reclaim-modal {
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    padding: 2rem 1.75rem;
    border-radius: 14px;
    text-align: center;
}

.reclaim-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.reclaim-modal-title {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.reclaim-modal-warning {
    color: rgba(255, 180, 60, 0.95);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.reclaim-modal-savings {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.reclaim-savings-value {
    color: #4caf50;
    font-size: 1.1rem;
}

.reclaim-challenge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.reclaim-challenge-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.reclaim-challenge-code {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 2px 14px;
}

.reclaim-challenge-input {
    width: 80px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    padding: 6px 10px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.reclaim-challenge-input:focus {
    border-color: rgba(255, 255, 255, 0.55);
}

.reclaim-challenge-input.input-valid {
    border-color: #4caf50;
}

.reclaim-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}