/* TempMail - Styles */
/* Theme: Deep Ocean 🔵 */

:root {
    --bg-body: #0d1b2a;
    --bg-card: #1b263b;
    --bg-card-hover: #243447;
    --text-main: #ffffff;
    --text-secondary: #8da9c4;
    --primary: #4cc9f0;
    --primary-glow: rgba(76, 201, 240, 0.3);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.1);
    --gradient-1: linear-gradient(135deg, #4cc9f0, #4895ef);
    --gradient-2: linear-gradient(135deg, #10b981, #059669);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-pattern {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(76, 201, 240, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(72, 149, 239, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.header {
    background: rgba(18, 18, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-info span {
    color: var(--text-secondary);
    font-size: 13px;
}

.user-info strong {
    color: var(--primary);
}

/* Header buttons group */
.header-content {
    gap: 8px;
}

/* Layout */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 24px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
}

.card-title i {
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.login-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.email-input-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}

.email-input-row {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.email-input-row input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 12px 16px;
    font-size: 15px;
    outline: none;
}

.email-input-row select {
    background: #1a1a25;
    border: 1px solid var(--border);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 160px;
}

/* Buttons - Optimized */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 40px;
    white-space: nowrap;
    text-decoration: none;
}

.btn i {
    font-size: 14px;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-success {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-full {
    width: 100%;
}

/* Small buttons - for header/compact areas */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
    border-radius: 8px;
    gap: 5px;
}

.btn-sm i {
    font-size: 12px;
}

/* Extra small - icon only */
.btn-xs {
    padding: 6px 8px;
    font-size: 11px;
    min-height: 28px;
    border-radius: 6px;
}

/* Icon-only button */
.btn-icon {
    padding: 8px;
    min-height: 36px;
    min-width: 36px;
    border-radius: 10px;
}

.btn-icon i {
    font-size: 14px;
    margin: 0;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    backdrop-filter: blur(4px);
}

.btn-ghost:hover {
    background: rgba(76, 201, 240, 0.1);
    color: var(--primary);
    border-color: rgba(76, 201, 240, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn:active {
    transform: scale(0.97) translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* QR Section */
.qr-section {
    margin-top: 20px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    text-align: center;
    display: none;
}

.qr-section.show {
    display: block;
}

/* Account List */
.account-list {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.account-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
}

.account-item:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

.account-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.account-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--gradient-1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.account-email {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.account-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.action-btn.forward-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.action-btn.forward-active:hover {
    background: rgba(16, 185, 129, 0.3);
}

/* Mailbox */
.mailbox-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.current-email-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.current-email {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.refresh-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--success);
    margin-bottom: 16px;
}

.refresh-indicator .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Search */
.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px 12px 44px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Mail List */
.mail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mail-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mail-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
    transform: translateX(4px);
}

.mail-item:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

.mail-content {
    flex: 1;
    min-width: 0;
}

.mail-sender {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-subject {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-time {
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: 16px;
    white-space: nowrap;
}

/* OTP */
.otp-container {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.otp-code {
    font-size: 28px;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 4px;
    color: var(--success);
}

.otp-copy-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 20px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 1;
}

.empty-state p {
    font-size: 15px;
    line-height: 1.5;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.modal-from {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.modal-body {
    padding: 0;
    background: #ffffff;
    color: #1a1a1a;
    flex: 1;
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Toast - see UI Enhancements section */
.notification-popup {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--success);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 350px;
    z-index: 1500;
    display: none;
}

.notification-popup.show {
    display: block;
    animation: slideIn 0.3s ease;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
}

.skeleton-item {
    height: 72px;
    margin-bottom: 10px;
}

/* Guest Notice */
.guest-notice {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Admin Section */
.admin-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.user-list {
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 8px;
}

.user-item.pending {
    border-left: 3px solid var(--warning);
}

.user-item .badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.user-item .badge.admin {
    background: var(--warning);
    color: #000;
}

.add-user-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.add-user-form input {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes copySuccess {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.copy-success {
    animation: copySuccess 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablet & Below - 900px */
@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* Tablet - 768px */
@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }

    .main-container {
        padding: 20px 16px;
        gap: 20px;
    }

    .card {
        padding: 20px;
    }

    .mailbox-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .current-email {
        font-size: 16px;
        word-break: break-all;
    }

    .current-email span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Mobile - 576px */
@media (max-width: 576px) {
    .header {
        padding: 12px 0;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: space-between;
    }

    .logo {
        font-size: 18px;
        gap: 8px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 10px;
    }

    .user-info {
        gap: 8px;
        flex-wrap: wrap;
    }

    #header-user-area {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        display: flex;
    }

    #header-user-area>span {
        display: none;
    }

    .main-container {
        padding: 16px;
        gap: 16px;
    }

    .card {
        padding: 16px;
        border-radius: 14px;
    }

    .btn-sm {
        padding: 10px 14px;
        min-height: 44px;
        font-size: 13px;
    }

    .email-input-wrapper {
        padding: 8px;
    }

    .email-input-row {
        flex-direction: column;
        gap: 10px;
    }

    .email-input-row input {
        padding: 14px 16px;
    }

    .email-input-row select {
        max-width: 100%;
        width: 100%;
        padding: 14px 16px;
    }

    .current-email {
        font-size: 14px;
    }

    .account-email {
        max-width: 180px;
    }

    .account-list {
        max-height: 250px;
    }

    .mail-item {
        padding: 14px 16px;
    }

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .notification-popup {
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .otp-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .otp-code {
        font-size: 24px;
        letter-spacing: 3px;
    }
}

/* Small Mobile - 400px */
@media (max-width: 400px) {
    .main-container {
        padding: 12px;
    }

    .card {
        padding: 14px;
        border-radius: 12px;
    }

    .card-title {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .header-actions {
        gap: 6px;
    }

    .header-actions .btn-sm {
        padding: 10px 12px;
        font-size: 12px;
    }

    .header-actions .btn-sm span {
        display: none;
    }

    .account-email {
        max-width: 130px;
        font-size: 13px;
    }

    .account-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 12px;
    }

    .mail-sender {
        font-size: 13px;
    }

    .mail-subject {
        font-size: 12px;
    }

    .mail-time {
        font-size: 11px;
        margin-left: 10px;
    }

    .search-box input {
        padding: 10px 14px 10px 40px;
        font-size: 13px;
    }

    .search-box i {
        left: 14px;
        font-size: 13px;
    }
}

/* ===== PREMIUM UI ENHANCEMENTS ===== */
/* Theme: Deep Ocean 🔵 */

/* Enhanced Background with animated gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(76, 201, 240, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(72, 149, 239, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientShift {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Glassmorphism Cards */
.card,
.email-create-section,
.mailbox-container,
.sidebar-accounts {
    background: rgba(18, 18, 26, 0.7) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* Premium Header */
.header {
    background: rgba(10, 10, 15, 0.85) !important;
    backdrop-filter: blur(24px) saturate(1.5) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2) !important;
}

/* Logo Glow Animation */
.logo-icon {
    position: relative;
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.5),
        0 0 40px rgba(99, 102, 241, 0.2);
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.5), 0 0 40px rgba(99, 102, 241, 0.2);
    }

    100% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.6), 0 0 60px rgba(139, 92, 246, 0.3);
    }
}

/* Enhanced Buttons */
.btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #6366f1 100%);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
    box-shadow:
        0 4px 20px rgba(99, 102, 241, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 30px rgba(99, 102, 241, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #10b981 100%);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating Input Effect */
.email-input-group {
    position: relative;
    transition: all 0.3s ease;
}

.email-input-group:focus-within {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Mail Item Hover Effects */
.mail-item {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.mail-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-1);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.mail-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(8px);
}

.mail-item:hover::before {
    transform: scaleY(1);
}

.mail-item.unread {
    border-left: 3px solid var(--primary);
}

/* Account Card Enhancement */
.account-item {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.account-item:hover {
    background: rgba(99, 102, 241, 0.15);
    transform: translateX(4px);
}

.account-item.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

.account-avatar {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.account-item:hover .account-avatar {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* Modal Enhancement */
.modal-content {
    background: rgba(18, 18, 26, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(99, 102, 241, 0.1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15) !important;
}

.modal-close {
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    transform: rotate(90deg);
}

/* Form Enhancements */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
    background: rgba(0, 0, 0, 0.5) !important;
}

/* Notification Popup Enhancement */
.notification-popup {
    background: rgba(18, 18, 26, 0.95) !important;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(16, 185, 129, 0.1);
    animation: notifSlideIn 0.4s ease-out;
}

@keyframes notifSlideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Spinner Enhancement */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.fa-sync.fa-spin,
.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* Action Buttons Enhancement */
.action-btn,
.header-action-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover,
.header-action-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.action-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.action-btn:hover::after {
    opacity: 1;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8b5cf6, #a78bfa);
}

/* Selection Color */
::selection {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* Pulse Animation for Live Indicator */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.refresh-indicator .dot {
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Footer Enhancement */
.footer {
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

/* Success/Error Message Enhancement */
.login-success {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #10b981 !important;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.login-error {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: #ef4444 !important;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    animation: shakeError 0.4s ease;
}

@keyframes shakeError {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State Enhancement */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Badge/Tag Enhancement */
.badge,
.tag,
.domain-tag {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    border: 1px solid rgba(99, 102, 241, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Quick Action Buttons Row */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.quick-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Copy Button Animation */
.btn-copy.copied {
    background: var(--success) !important;
    animation: copyPulse 0.5s ease;
}

@keyframes copyPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive Premium Adjustments */
@media (max-width: 768px) {
    body::before {
        background:
            radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.2) 0%, transparent 60%);
    }

    .modal-content {
        border-radius: 16px 16px 0 0 !important;
        margin-top: auto;
        height: 95vh;
    }

    .mail-item:hover {
        transform: none;
    }
}

/* ===== UI ENHANCEMENTS ===== */

/* 1. Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-line.full {
    width: 100%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-mail-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.skeleton-mail-content {
    flex: 1;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* 2. Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 3. Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* 4. Improved Toast */
.toast {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: toast-pop-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 12px;
    font-weight: 500;
}

.toast-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 8px;
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast-success .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
}

.toast-info {
    background: linear-gradient(135deg, #4cc9f0, #4895ef);
}

@keyframes toast-pop-in {
    from {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* 5. Light/Dark Mode */
:root {
    --mode-transition: 0.3s ease;
}

body.light-mode {
    --bg-body: #dce4ec;
    --bg-card: #f8fafc;
    --bg-card-hover: #f1f5f9;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --primary: #0891b2;
    --primary-glow: rgba(8, 145, 178, 0.25);
    --border: rgba(0, 0, 0, 0.15);
    --success: #059669;
    --danger: #dc2626;
}

body.light-mode .bg-pattern {
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

body.light-mode .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-bottom: none !important;
}

body.light-mode .header .logo,
body.light-mode .header .logo span {
    color: #ffffff !important;
}

body.light-mode .header .btn-ghost {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

body.light-mode .header .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

body.light-mode .header #header-user-area,
body.light-mode .header #header-user-area span,
body.light-mode .header #header-user-area strong {
    color: #ffffff !important;
}

body.light-mode .card {
    background: #f8fafc !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
}

body.light-mode .modal-content {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: #e8eef3 !important;
    color: #0f172a !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

body.light-mode input::placeholder {
    color: #64748b !important;
}

body.light-mode .email-input-wrapper {
    background: #dce4ec !important;
    border-radius: 16px !important;
    padding: 4px !important;
}

body.light-mode .email-input-row {
    background: #f8fafc !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    overflow: hidden;
}

body.light-mode .email-input-row input,
body.light-mode .email-input-row select {
    background: transparent !important;
    border: none !important;
    color: #0f172a !important;
}

body.light-mode .mail-item {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

body.light-mode .mail-item:hover {
    background: #f1f5f9;
}

body.light-mode .mail-item .subject,
body.light-mode .mail-item .from {
    color: #1e293b;
}

body.light-mode .mail-item .preview,
body.light-mode .mail-item .time {
    color: #64748b;
}

body.light-mode .btn-ghost {
    background: #e2e8f0 !important;
    color: #475569 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .btn-ghost:hover {
    background: #c7d2fe !important;
    color: #4f46e5 !important;
}

body.light-mode .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
}

body.light-mode .btn-primary:hover {
    filter: brightness(1.1);
}

body.light-mode .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

body.light-mode .logo span,
body.light-mode .logo {
    color: #0f172a !important;
}

body.light-mode .card-title,
body.light-mode h1,
body.light-mode h2,
body.light-mode h3 {
    color: #0f172a !important;
}

body.light-mode .account-item {
    background: #e2e8f0 !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #0f172a !important;
    padding: 10px 12px !important;
}

body.light-mode .account-item .email-display,
body.light-mode .account-item span {
    color: #0f172a !important;
    font-size: 13px;
}

body.light-mode .account-item .btn,
body.light-mode .account-item button {
    width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    font-size: 12px !important;
    border-radius: 6px !important;
}

body.light-mode .account-item .btn-ghost {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #64748b !important;
}

body.light-mode .account-item .btn-ghost:hover {
    background: #c7d2fe !important;
    color: #4f46e5 !important;
}

body.light-mode .account-item .btn-danger,
body.light-mode .account-item button[onclick*="delete"] {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

body.light-mode .account-item .btn-danger:hover {
    background: #fecaca !important;
}

body.light-mode .account-item.active {
    background: #c7d2fe !important;
    border-color: #6366f1 !important;
}

body.light-mode .bottom-nav {
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .bottom-nav-item {
    color: #64748b;
}

body.light-mode .bottom-nav-item.active,
body.light-mode .bottom-nav-item:hover {
    color: #0891b2;
}

body.light-mode .shortcuts-help,
body.light-mode .quick-actions {
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

body.light-mode .empty-state {
    color: #64748b;
}

body.light-mode .current-email-label {
    color: #64748b;
}

body.light-mode #active-email {
    color: #0891b2;
}

body.light-mode .search-box {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .search-box input {
    color: #1e293b !important;
}

body.light-mode footer {
    color: #64748b;
    border-top-color: rgba(0, 0, 0, 0.1);
}

.theme-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--bg-card);
    border-radius: 13px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: var(--mode-transition);
}

.theme-toggle::after {
    content: '🌙';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: var(--mode-transition);
}

body.light-mode .theme-toggle::after {
    left: calc(100% - 22px);
    content: '☀️';
}

/* 6. Bottom Navigation (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(27, 38, 59, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    transition: all 0.2s;
    border-radius: 12px;
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
    background: rgba(76, 201, 240, 0.1);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: block;
    }

    body {
        padding-bottom: 80px;
    }
}

/* 7. Quick Actions Menu */
.quick-actions {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.quick-actions.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px) scale(1);
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
}

.quick-action-item:hover {
    background: rgba(76, 201, 240, 0.1);
    color: var(--primary);
}

.quick-action-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.quick-action-item:hover i {
    color: var(--primary);
}

.quick-action-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* 8. Keyboard Shortcuts */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    box-shadow: 0 2px 0 var(--border);
}

.shortcuts-help {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
}

.shortcuts-help.show {
    display: block;
    animation: fade-in 0.2s ease;
}

.shortcuts-help h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--primary);
}

.shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
}

/* 9. Onboarding Tour */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
}

.onboarding-highlight {
    position: absolute;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    z-index: 9999;
}

.onboarding-tooltip {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 16px;
    padding: 20px;
    max-width: 320px;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.onboarding-tooltip h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 16px;
}

.onboarding-tooltip p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.onboarding-steps {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.onboarding-step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.onboarding-step.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
}

/* 10. Page Transitions */
.page-transition {
    animation: page-fade-in 0.3s ease;
}

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Smooth transitions for all elements */
body,
.card,
.btn,
.mail-item,
.modal-content {
    transition: background-color var(--mode-transition),
        color var(--mode-transition),
        border-color var(--mode-transition);
}

/* ===== FOOTER STYLES ===== */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 40px 24px 24px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto 24px;
}

.footer-section h4 {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section li i {
    color: var(--success);
    font-size: 10px;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-section a i {
    color: var(--primary);
    font-size: 11px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 4px 0;
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* Light mode footer */
body.light-mode .site-footer {
    background: #f1f5f9;
}

body.light-mode .footer-section h4 {
    color: #4f46e5;
}

body.light-mode .footer-section p,
body.light-mode .footer-section li,
body.light-mode .footer-bottom p {
    color: #475569;
}

body.light-mode .footer-section a {
    color: #475569;
}

body.light-mode .footer-section a:hover {
    color: #4f46e5;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section h4,
    .footer-section li,
    .footer-section a {
        justify-content: center;
    }

    .site-footer {
        padding-bottom: 80px;
        /* Space for bottom nav */
    }
}

/* ===== FAQ SECTION ===== */
.footer-faq {
    max-width: 1000px;
    margin: 24px auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer-faq h4 {
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.faq-item strong {
    color: var(--text-main);
    font-size: 13px;
    display: block;
    margin-bottom: 6px;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
}

/* Light mode FAQ */
body.light-mode .footer-faq h4 {
    color: #4f46e5;
}

body.light-mode .faq-item {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .faq-item strong {
    color: #1e293b;
}

body.light-mode .faq-item p {
    color: #64748b;
}

@media (max-width: 768px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .footer-faq h4 {
        justify-content: center;
    }
}

/* ===== MAILBOX HEADER ===== */
.mailbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.header-actions .btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
    height: 28px !important;
    min-height: 28px !important;
}

.header-actions .btn i {
    font-size: 10px;
}

.current-email-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.current-email {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

body.light-mode .mailbox-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .current-email-label {
    color: #64748b;
}

body.light-mode .current-email {
    color: #4f46e5;
}

body.light-mode .header-actions .btn-ghost {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

body.light-mode .header-actions .btn-danger {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* Hide horizontal scrollbar on account/email lists */
#accounts-list,
.accounts-list,
.mail-list,
.card {
    overflow-x: hidden !important;
}

.account-item {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Language flag button */
.lang-flag-btn {
    padding: 4px 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-flag-btn svg {
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Action button (Star/Pin) in mail list */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--warning);
}

.mail-item {
    display: flex;
    align-items: center;
}

body.light-mode .action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Tab buttons for All/Pinned accounts */
.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tab-btn i {
    font-size: 10px;
}

/* Light mode tabs */
body.light-mode .tab-btn {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #64748b;
}

body.light-mode .tab-btn:hover {
    background: #cbd5e1;
    color: #1e293b;
}

body.light-mode .tab-btn.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

/* Pin button in account item */
.pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.2s;
}

.pin-btn:hover {
    color: var(--warning);
}

.pin-btn.pinned {
    color: var(--warning);
}

/* Responsive header for mobile/tablet */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px !important;
    }

    .header-content>div:last-child {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px !important;
    }

    .header .btn-sm,
    .header .btn-ghost {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }

    .header .btn-icon {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
    }

    /* Hide text on small screens, show only icons */
    #api-key-btn span,
    #api-key-btn:not(:has(span))::after {
        display: none;
    }

    #api-key-btn {
        padding: 6px 10px !important;
    }

    /* Compact flag button */
    #lang-switcher {
        padding: 4px 8px !important;
    }

    #lang-switcher #lang-text {
        display: none;
    }

    /* Admin button compact */
    #admin-link-btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo span {
        font-size: 16px !important;
    }

    .logo-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .header-content>div:last-child {
        width: 100%;
        justify-content: center;
    }
}

/* QR Code Section */
.qr-section {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.qr-section.show {
    display: flex;
}

.qr-section canvas {
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

body.light-mode .qr-section {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

body.light-mode .qr-section canvas {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}