/* static/css/theme.css - Modern UI Overrides */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

/* Login Page Enhancements */
body.login-body {
    background: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        #f8fafc;
}

.login-card {
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.05);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: none;
    padding: 8px;
}

.login-logo {
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.6);
    border-radius: 16px;
}

.login-field input {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.login-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: #fff;
}

.btn-primary {
    background: #0f172a;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:active {
    transform: translateY(0);
}

/* App Layout Enhancements */
.app-container {
    background: #f1f5f9;
    padding: 16px;
    gap: 16px;
    box-sizing: border-box;
}

.left-panel {
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    background: #ffffff;
}

.right-panel {
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    background: #ffffff;
}

/* Header & Inputs */
.panel-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 24px;
}

.panel-header h1 svg {
    color: #6366f1;
}

.btn-logout {
    border-radius: 10px;
    font-weight: 600;
}

.custom-email-input-full {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    background: #f8fafc;
    transition: all 0.2s;
}

.custom-email-input-full:focus {
    background: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

/* Modern Custom Select */
.modern-select-wrapper {
    position: relative;
    width: 100%;
}
.modern-select-trigger {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #0f172a;
    font-weight: 500;
    user-select: none;
}
.modern-select-trigger:hover {
    border-color: #cbd5e0;
}
.modern-select-wrapper.open .modern-select-trigger {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: #ffffff;
}
.modern-select-wrapper.open .modern-select-trigger svg {
    transform: rotate(180deg);
}
.modern-select-trigger svg {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
    flex-shrink: 0;
    margin-left: 12px;
}
.modern-select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modern-select-wrapper.open .modern-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.modern-option {
    padding: 12px 16px;
    cursor: pointer;
    color: #334155;
    transition: background 0.15s;
    font-size: 14px;
}
.modern-option:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.modern-option.selected {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

/* Mail List */
.mail-list-header {
    border-bottom: 1px solid #f1f5f9;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

.mail-count {
    background: #e0e7ff;
    color: #4f46e5;
    font-weight: 600;
}

.mail-item {
    margin: 8px 12px;
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 16px;
    border-bottom: none !important;
}

.mail-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.mail-item.active {
    background: #e0e7ff;
    border-color: #c7d2fe;
    border-left: none !important;
    box-shadow: inset 4px 0 0 #4f46e5;
}

.mail-item.unread::before {
    background: #6366f1;
    left: 8px;
    top: 24px;
}

.mail-subject {
    font-weight: 600;
    color: #0f172a;
    font-size: 15px;
}

.mail-from {
    color: #475569;
    font-weight: 500;
    margin-top: 2px;
}

.mail-preview {
    color: #64748b;
    margin-top: 6px;
    line-height: 1.5;
}

.btn-delete {
    opacity: 0;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 8px;
    padding: 6px;
}

.mail-item:hover .btn-delete {
    opacity: 1;
}

.btn-delete:hover {
    background: #fca5a5;
    color: #b91c1c;
}

/* Detail View */
.mail-detail {
    padding: 48px 56px;
    max-width: 1000px;
}

.empty-state svg {
    stroke: #94a3b8;
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
}
.empty-state p {
    font-weight: 500;
    color: #64748b;
    font-size: 16px;
}

.mail-detail-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 32px;
    margin-bottom: 32px;
}

.mail-detail-subject {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.meta-label {
    color: #64748b;
    width: 64px;
}

.meta-value {
    color: #0f172a;
    font-weight: 500;
}

.info-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.btn-copy {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-copy:hover {
    border-color: #cbd5e0;
    color: #0f172a;
}

.status-message {
    border-radius: 12px;
    font-weight: 500;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
    border: 2px solid #ffffff;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
.mail-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile responsive resets */
@media (max-width: 768px) {
    .app-container {
        padding: 0;
        gap: 0;
    }
    .left-panel, .right-panel {
        border-radius: 0;
        height: 100vh;
        border: none;
        box-shadow: none;
    }
    .mail-detail {
        padding: 24px;
    }
    .mail-detail-subject {
        font-size: 24px;
    }
    .mail-item {
        margin: 4px 8px;
    }
}
