/* Global Reset */

:root {
    --primary: #3b82f6;
    /* Modern Blue */
    --primary-hover: #2563eb;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --glass: rgba(30, 41, 59, 0.7);
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }
    .desktop-only {
        display: none !important;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */

.header-wrapper {
    border-bottom: 1px solid var(--border);
    background: var(--glass);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

@media (max-width: 768px) {
    header {
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1.5rem;
    }
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

header nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    header nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 1.5rem;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 0.75rem;
        flex-direction: column;
        width: 220px;
        padding: 0.5rem;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        margin-top: 0.5rem;
    }
    header nav.active {
        display: flex;
        animation: slide-in-down 0.2s ease-out;
    }
    .nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
        justify-content: flex-start;
    }
    .lang-dropdown {
        width: 100%;
        margin-left: 0;
    }
    .lang-drop-btn {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        border: none;
        background: transparent;
    }
    .lang-drop-content {
        display: none;
        position: static;
        padding-top: 0;
        width: 100%;
    }
    .lang-dropdown.mobile-open .lang-drop-content {
        display: block;
    }
    .lang-drop-inner {
        box-shadow: none;
        border: none;
        background: rgba(0, 0, 0, 0.1);
        margin: 0 0.5rem 0.5rem;
        min-width: 0;
    }
    .lang-drop-inner a {
        padding: 0.75rem 1rem;
    }
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Main Container */

.container {
  
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hero Section / Email Generator */

.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.email-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.email-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.email-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-dark);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

#current-email {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 600;
    width: 100%;
    outline: none;
    letter-spacing: 0.02em;
}

.email-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.action-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.action-btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.action-btn.secondary:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* Mobile Responsive */

@media (max-width: 768px) {
    .hero {
        padding: 2rem 0;
    }
    .hero h1 {
        font-size: 1.75rem;
    }
    .hero p {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    .container {
        padding: 1rem;
        gap: 1.5rem;
    }
    .email-box {
        border-radius: 0.75rem;
        padding: 0.75rem;
    }
    .email-input-group {
        padding: 0.6rem 0.75rem;
    }
    #current-email {
        font-size: 1rem;
    }
    .action-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        flex: 1;
        min-width: calc(50% - 0.5rem);
        min-height: 48px;
        /* Thumb friendly */
    }
    .email-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    #btn-new {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .email-input-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    #current-email {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
}

/* Domain Selection */

.domain-select {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    outline: none;
}

/* Inbox Area */

.inbox-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    height: 600px;
    min-height: 400px;
}

@media (max-width: 768px) {
    .inbox-grid {
        grid-template-columns: 1fr;
        height: auto;
        display: flex;
        flex-direction: column;
    }
    .msg-list {
        max-height: 400px;
    }
    .msg-view {
        min-height: 300px;
        order: -1;
        order: 2;
    }
    /* Active message viewing mode on mobile */
    .inbox.viewing-msg .msg-list {
        display: none;
    }
    .inbox.viewing-msg .msg-view {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        border-radius: 0;
        padding: 1rem;
    }
}

.msg-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow-y: auto;
}

.msg-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

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

.msg-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary);
}

.msg-sender {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-subject {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.msg-time {
    font-size: 0.75rem;
    color: #64748b;
    text-align: right;
}

@media (max-width: 768px) {
    .msg-list {
        border-radius: 1rem 1rem 0 0;
    }
    .msg-view {
        border-radius: 0 0 1rem 1rem;
        border-top: none;
    }
    .inbox.viewing-msg .msg-view {
        border-radius: 0;
        border: none;
        overflow-y: auto;
    }
}

.msg-view {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

@media (max-width: 480px) {
    .msg-view {
        padding: 1rem;
    }
}

.msg-view.has-content {
    display: block;
    justify-content: flex-start;
    align-items: stretch;
    color: var(--text-main);
}

.msg-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.msg-body {
    line-height: 1.6;
}

/* Animations */

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Loader */

.loader {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Footer - Minimalist Design */

footer {
    margin-top: auto;
    background: rgba(15, 23, 42, 0.3);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 2.5rem 0 1.5rem;
    position: relative;
    z-index: 1;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-links-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-links-wrapper a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.footer-links-wrapper a:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.footer-links-wrapper a i {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Mobile Responsive */

@media (max-width: 768px) {
    footer {
        padding: 2rem 0 1rem;
    }
    .footer-container {
        padding: 0 1.5rem;
    }
    .footer-links-wrapper {
        gap: 1rem;
        padding-bottom: 1.25rem;
        margin-bottom: 1.25rem;
    }
    .footer-links-wrapper a {
        font-size: 0.875rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .footer-container {
        padding: 0 1rem;
    }
    .footer-links-wrapper {
        gap: 0.75rem;
    }
    .footer-links-wrapper a {
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }
    .footer-links-wrapper a i {
        font-size: 0.8rem;
    }
}

/* Notification Popup */

.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.notification-overlay.active {
    opacity: 1;
    visibility: visible;
}

.notification-card {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem 2rem;
    max-width: 500px;
    width: calc(100% - 2rem);
    margin: 1rem;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notification-overlay.active .notification-card {
    transform: translateY(0) scale(1);
}

.notification-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.notification-content h2 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.notification-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.notification-content strong {
    color: white;
}

.notification-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    text-align: center;
    border-radius: 0.75rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: opacity 0.2s;
}

/* Admin Dropdown Styles */

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-drop-btn {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.nav-dropdown:hover .nav-drop-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-card);
    min-width: 180px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.4);
    z-index: 1000;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    padding: 0.25rem;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.25rem;
}

.nav-dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Language Dropdown */

.lang-dropdown {
    position: relative;
    margin-left: auto;
}

.lang-drop-btn {
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 500;
}

.lang-drop-btn:hover,
.lang-dropdown:hover .lang-drop-btn {
    color: white;
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.lang-dropdown:hover .lang-drop-content {
    display: block;
    animation: slide-in-down 0.2s ease-out;
}

.lang-drop-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    padding-top: 0.5rem;
    z-index: 100;
}

.lang-drop-inner {
    background: var(--bg-card);
    min-width: 180px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 0.25rem;
}

.lang-drop-content a {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0.25rem;
    transition: all 0.15s;
}

.lang-drop-content a:hover {
    background: var(--bg-dark);
    color: white;
}

.lang-drop-content a.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

@keyframes slide-in-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Blog Posts Section from Index */

.blog-posts-section {
    animation: fadeIn 0.6s ease-out;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.2);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.blog-card-placeholder {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(168, 85, 247, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
}

.blog-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.5));
}

.blog-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.blog-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog-card-title a {
    color: white;
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card-title a:hover {
    color: var(--primary);
}

.blog-card-excerpt {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.blog-card-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s;
}

.blog-card-link:hover {
    gap: 0.75rem;
}

.blog-card-link i {
    transition: transform 0.2s;
}

.blog-card-link:hover i {
    transform: translateX(3px);
}

/* Modals */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    /* Display is handled by JS (flex/none) */
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.75rem;
    color: var(--danger);
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: white;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
/* ===== FIX FULL WIDTH CONTAINER ===== */
.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.email-box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* ===== UPLOAD FILE BOX ===== */
.upload-box {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 600;
}

.upload-header i {
    color: var(--primary);
}

.upload-header label {
    margin: 0;
    color: white;
    font-weight: 600;
}

.upload-content {
    display: grid;
    grid-template-columns: 6fr 4fr; /* <-- FIX */
    gap: 0.75rem;
    align-items: center;
}

.upload-content input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
}

#btn-read-file {
    height: 100%;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
}

.upload-box small {
    color: var(--text-muted);
    display: block;
    margin-top: 0.5rem;
}

/* Mobile */
@media (max-width: 768px) {
    .upload-content {
        grid-template-columns: 1fr;
    }

    #btn-read-file {
        width: 100%;
    }
}
.email-buttons {
    display: flex;
    gap: 0.5rem;
}

#btn-quick-buy {
    flex: 7;
}

#btn-contact {
    flex: 3;
}
@media (max-width: 768px) {
    .email-buttons {
        grid-template-columns: 7fr 3fr;
    }

    .email-buttons button {
        font-size: 0.85rem;
        padding: 0.7rem;
    }
}
/* ===== FIX EMAIL BUTTONS 7/3 ALL DEVICES ===== */
.email-buttons {
    display: grid !important;
    grid-template-columns: 7fr 3fr !important;
    gap: 0.5rem;
    width: 100%;
}

.email-buttons .action-btn {
    width: 100%;
    min-width: 0 !important;
    flex: none !important;
}

#btn-quick-buy {
    grid-column: auto;
}

#btn-contact {
    grid-column: auto;
}

/* Mobile vẫn giữ 7/3 */
@media (max-width: 768px) {
    .email-buttons {
        display: grid !important;
        grid-template-columns: 7fr 3fr !important;
    }

    .email-buttons .action-btn {
        font-size: 0.85rem;
        padding: 0.7rem 0.5rem;
        min-width: 0 !important;
    }
}
.hero h1 {
    max-width: 900px;
    margin: 0 auto 1rem;
}

.hero p {
    max-width: 760px;
    margin: 0 auto 1.5rem;
}

/* Nút mua + support đưa lên trên */
.hero-actions {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 0.75rem;
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

.hero-actions .action-btn {
    width: 100%;
    min-width: 0 !important;
}

/* Box nhập credential */
.credential-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.box-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.box-header i {
    color: var(--primary);
}

.box-header label {
    color: white;
    font-weight: 600;
    margin: 0;
}

#outlook-credentials {
    width: 100%;
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: white;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    resize: vertical;
    height: 220px;
    font-family: monospace;
    line-height: 1.6;
}

.credential-box small {
    color: var(--text-muted);
    display: block;
    margin-top: 0.5rem;
}

/* Mobile vẫn giữ 7/3 cho nút trên */
@media (max-width: 768px) {
    .hero-actions {
        grid-template-columns: 7fr 3fr;
        gap: 0.5rem;
    }

    .hero-actions .action-btn {
        font-size: 0.8rem;
        padding: 0.7rem 0.45rem;
    }

    .hero-actions .action-btn i {
        margin-right: 0;
    }

    .hero h1 {
        font-size: 1.65rem;
    }

    .hero p {
        font-size: 0.95rem;
    }
}
/* PC layout */
.textarea-footer {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    margin-top: 0.5rem;
}

/* Đếm bên trái */
.email-count {
    justify-self: start;
}

/* Format nằm giữa */
.format-text {
    justify-self: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 768px) {
    .textarea-footer {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .email-count {
        order: 1;
    }

    .format-text {
        order: 2;
        text-align: left;
    }
}
/* ===== MOBILE RESULT TABLE FIX ===== */
@media (max-width: 768px) {

    #tableResult table {
        display: block;
        width: 100%;
    }

    #tableResult thead {
        display: none; /* Ẩn header trên mobile */
    }

    #tableResult tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    #tableResult tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 0.75rem;
        padding: 0.75rem;
    }

    #tableResult td {
        display: flex;
        justify-content: space-between;
        padding: 0.4rem 0;
        font-size: 0.85rem;
        border: none !important;
    }

    /* Label trước mỗi field */
    #tableResult td:nth-child(1)::before { content: "STT"; }
    #tableResult td:nth-child(2)::before { content: "From"; }
    #tableResult td:nth-child(3)::before { content: "Subject"; }
    #tableResult td:nth-child(4)::before { content: "Time"; }
    #tableResult td:nth-child(5)::before { content: "Code"; }
    #tableResult td:nth-child(6)::before { content: "Action"; }

    #tableResult td::before {
        font-weight: 600;
        color: var(--text-muted);
        margin-right: 10px;
    }

    /* Action button full width */
    #tableResult td:last-child {
        justify-content: center;
        margin-top: 0.5rem;
    }

    #tableResult button {
        width: 100%;
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

#emailModal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.55) !important;
    padding: 1.75rem !important;
}

#emailModal .modal-content,
#emailModal .email-modal-content {
    width: 100% !important;
    max-width: 1140px !important;
    height: calc(100vh - 3.5rem) !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

#emailContent {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#mailFrame {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    display: block !important;
}
.nav-select {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.45rem 0.7rem;
    outline: none;
}

.theme-btn {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
}

.theme-btn:hover,
.nav-select:hover {
    border-color: var(--primary);
}
/* ===== LIGHT THEME FIX FULL ===== */
body.light-theme {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.85);

    background: var(--bg-dark) !important;
    color: var(--text-main) !important;
}

/* Text chung */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme p,
body.light-theme span,
body.light-theme label,
body.light-theme small,
body.light-theme div {
    color: inherit;
}

/* Header */
body.light-theme .header-wrapper,
body.light-theme header nav,
body.light-theme .lang-drop-inner,
body.light-theme .nav-dropdown-content {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

body.light-theme .nav-link,
body.light-theme .nav-drop-btn,
body.light-theme .lang-drop-btn,
body.light-theme .lang-drop-content a {
    color: var(--text-muted) !important;
}

body.light-theme .nav-link:hover,
body.light-theme .nav-dropdown:hover .nav-drop-btn,
body.light-theme .lang-drop-content a:hover {
    color: var(--text-main) !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

/* Cards / boxes */
body.light-theme .email-box,
body.light-theme .msg-list,
body.light-theme .msg-view,
body.light-theme .blog-card,
body.light-theme .credential-box,
body.light-theme .upload-box,
body.light-theme .modal-content {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
}

/* Input areas */
body.light-theme .email-input-group,
body.light-theme #outlook-credentials,
body.light-theme select,
body.light-theme .nav-select {
    background: #f1f5f9 !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
}

body.light-theme #current-email {
    color: var(--text-main) !important;
}

/* Fix các chỗ đang hardcode white */
body.light-theme .modal-content h3,
body.light-theme .upload-header,
body.light-theme .upload-header label,
body.light-theme .box-header label,
body.light-theme .blog-card-title a,
body.light-theme .notification-content h2,
body.light-theme .notification-content strong {
    color: var(--text-main) !important;
}

/* Text phụ */
body.light-theme .hero p,
body.light-theme .msg-subject,
body.light-theme .msg-time,
body.light-theme .blog-card-meta,
body.light-theme .blog-card-excerpt,
body.light-theme .footer-bottom p,
body.light-theme .format-text,
body.light-theme .email-count,
body.light-theme .credential-box small,
body.light-theme .upload-box small {
    color: var(--text-muted) !important;
}

/* Footer */
body.light-theme footer {
    background: #ffffff !important;
    border-color: var(--border) !important;
}

body.light-theme .footer-links-wrapper {
    border-color: var(--border) !important;
}

body.light-theme .footer-links-wrapper a {
    color: var(--text-muted) !important;
}

body.light-theme .footer-links-wrapper a:hover {
    color: var(--primary) !important;
}

/* Modal close button */
body.light-theme #emailModalClose {
    color: var(--text-main) !important;
}

/* Table mobile cards */
body.light-theme #tableResult tr {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
}

body.light-theme #tableResult td::before {
    color: var(--text-muted) !important;
}

/* Buttons giữ chữ trắng */
body.light-theme .action-btn,
body.light-theme .notification-btn {
    color: #ffffff !important;
}

body.light-theme .action-btn.secondary {
    color: var(--text-main) !important;
    background: transparent !important;
}

/* Theme button */
body.light-theme .theme-btn {
    background: #f1f5f9 !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
}

/* Logo gradient không bị inherit */
body.light-theme .logo span {
    background: linear-gradient(135deg, #2563eb, #9333ea) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
/* ===== LIGHT THEME FIX EMAIL RESULTS ===== */
body.light-theme #resultMail,
body.light-theme #tableResult,
body.light-theme #tableResult .card,
body.light-theme #tableResult .table-responsive {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
}

body.light-theme #tableResult table,
body.light-theme #tableResult .table {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
}

body.light-theme #tableResult thead,
body.light-theme #tableResult th {
    background: #f1f5f9 !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
}

body.light-theme #tableResult tbody,
body.light-theme #tableResult tr,
body.light-theme #tableResult td {
    background: #ffffff !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
}

body.light-theme #tableResult .text-muted {
    color: var(--text-muted) !important;
}

body.light-theme #tableResult .text-danger {
    color: #dc2626 !important;
}

body.light-theme #tableResult .badge {
    color: #ffffff !important;
}

/* Nút chính giữ chữ trắng */
body.light-theme #tableResult button:not(.secondary) {
    color: #ffffff !important;
}

/* Nút secondary như nút Xem */
body.light-theme #tableResult .action-btn.secondary,
body.light-theme #tableResult button.action-btn.secondary {
    color: var(--text-main) !important;
    background: #f1f5f9 !important;
    border: 1px solid var(--border) !important;
}

body.light-theme #tableResult .action-btn.secondary i,
body.light-theme #tableResult button.action-btn.secondary i {
    color: inherit !important;
}

body.light-theme #tableResult .action-btn.secondary:hover {
    color: var(--primary) !important;
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: var(--primary) !important;
}

/* Mobile card result */
@media (max-width: 768px) {
    body.light-theme #tableResult tr {
        background: #ffffff !important;
        color: var(--text-main) !important;
        border-color: var(--border) !important;
    }

    body.light-theme #tableResult td {
        color: var(--text-main) !important;
    }

    body.light-theme #tableResult td::before {
        color: var(--text-muted) !important;
    }
}
.payment-method-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.payment-option {
    cursor: pointer;
}

    .payment-option input {
        display: none;
    }

    .payment-option span {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        padding: 0.8rem 0.5rem;
        border-radius: 0.6rem;
        border: 1px solid var(--border);
        background: var(--bg-card);
        color: white;
        font-weight: 600;
        transition: 0.2s;
    }

    .payment-option input:checked + span {
        border-color: #22c55e;
        background: rgba(34, 197, 94, 0.15);
        color: #22c55e;
    }

    .payment-option span:hover {
        border-color: #22c55e;
    }

@media (max-width: 520px) {
    .payment-method-box {
        grid-template-columns: 1fr;
    }
}
.account-result-card {
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.account-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
}

.account-result-header strong {
    color: var(--primary);
    margin-right: 0.5rem;
}

.account-result-header span {
    color: white;
}

.status-badge {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.loading {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
}

.status-badge.success {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.status-badge.error {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

.account-result-body {
    padding: 1rem;
    color: white;
}

.mail-item {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    margin-bottom: 0.75rem;
    background: rgba(255,255,255,0.03);
}

.mail-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.mail-top strong {
    color: white;
}

.mail-top span,
.mail-from {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.mail-code {
    display: inline-block;
    margin-top: 0.5rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.35rem;
    font-weight: 600;
}

.error-text {
    color: #ef4444;
}

.empty-mail {
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .account-result-header,
    .mail-top {
        flex-direction: column;
        align-items: flex-start;
    }
}
#globalMailLimit {
    cursor: pointer;
    transition: 0.2s;
}

    #globalMailLimit:hover {
        border-color: var(--primary);
    }
