/* 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 {
    max-width: 1200px;
    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;
    max-width: 800px;
    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-muted);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* 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;
}