@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --bg-main: #0B0F19;
    --bg-card: rgba(22, 30, 49, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.5);
    
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --primary: #3B82F6;
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --accent: #10B981;
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.05);
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Background highlights for premium depth */
body::before, body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}
body::before {
    top: 5%;
    left: 10%;
    background: #3B82F6;
}
body::after {
    top: 40%;
    right: 10%;
    background: #8B5CF6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: #60A5FA;
}

button {
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

/* Core Container Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Header & Logo styling */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-section:hover .logo-icon {
    transform: rotate(5deg) scale(1.05);
}

.logo-section h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #9CA3AF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Main Display Address Card */
.address-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main), var(--shadow-inset);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
}

.address-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.address-display-wrapper {
    width: 100%;
    max-width: 600px;
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.address-text {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}

.address-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon.copied {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.address-control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    max-width: 600px;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* History Dropdown / Switch Address list */
.history-dropdown-wrapper {
    position: relative;
    width: 100%;
    max-width: 250px;
}

.history-select {
    width: 100%;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 40px;
}

.history-select:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.history-dropdown-wrapper::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-secondary);
    pointer-events: none;
}

/* Inbox & Layout split */
.inbox-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 480px;
}

/* Inbox Left Column (Email List) */
.inbox-sidebar {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(10, 15, 25, 0.2);
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.refresh-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

.email-list {
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
}

.email-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

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

.email-item.active {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-item-sender {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-item-timer {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.email-item-timer.critical {
    color: var(--danger);
    background: var(--danger-light);
}

.email-item-subject {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.no-emails {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.no-emails svg {
    opacity: 0.3;
}

/* Inbox Right Column (Email Viewer) */
.inbox-viewer {
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.15);
    height: 100%;
}

.viewer-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 12px;
    padding: 40px;
}

.viewer-placeholder svg {
    opacity: 0.3;
}

.viewer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.viewer-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.viewer-subject {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
}

.viewer-meta-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
    gap: 8px;
}

.viewer-actions {
    display: flex;
    gap: 8px;
}

.viewer-security-bar {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #FBBF24;
}

.btn-security {
    background: #FBBF24;
    color: #000000;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    transition: background 0.2s;
}

.btn-security:hover {
    background: #F59E0B;
}

.viewer-body-container {
    flex: 1;
    padding: 0;
    position: relative;
    background: #ffffff;
    min-height: 350px;
}

.email-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

/* Informative / SEO Content Section */
.seo-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 20px;
}

.seo-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
}

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

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.info-card-icon {
    width: 48px;
    height: 48px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.info-card h3 {
    font-size: 18px;
    color: #ffffff;
    font-weight: 600;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.faq-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-section h3 {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 5px;
    text-align: center;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-question {
    font-weight: 600;
    color: #ffffff;
    font-size: 15px;
    margin-bottom: 6px;
}

.faq-answer {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Footer Section */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
}

/* Legal Pages Styling */
.legal-page {
    background-color: var(--bg-main);
    color: var(--text-primary);
    padding: 40px 20px;
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-main);
}

.legal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.back-link:hover {
    color: #ffffff;
}

.legal-header h1 {
    font-size: 32px;
    color: #ffffff;
    font-weight: 700;
}

.last-updated {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.legal-content section {
    margin-bottom: 30px;
}

.legal-content h2 {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 600;
}

.legal-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.legal-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

.legal-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.legal-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 40px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Notification banner style */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-main);
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--danger);
}

/* Mobile Responsiveness Rules */
@media (max-width: 900px) {
    .inbox-card {
        grid-template-columns: 1fr; /* Stack sidebar and viewer */
    }
    
    .inbox-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .email-list {
        max-height: 250px;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 12px;
    }
    
    .address-display-wrapper {
        padding: 10px 14px;
    }
    
    .address-text {
        font-size: 16px;
    }
    
    .address-control-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .history-dropdown-wrapper {
        max-width: 100%;
    }
    
    .legal-container {
        padding: 20px;
    }
    
    .legal-header h1 {
        font-size: 24px;
    }
}
