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

:root {
    --bg-main: #f8fafc;
    --bg-sidebar: #020617; /* Midnight Slate 950 */
    --card-bg: #ffffff;
    --primary-color: #10b981; /* Vibrant Emerald */
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.2);
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #64748b; /* Slate 500 */
    --accent-success: #059669;
    --accent-success-bg: #d1fae5;
    --accent-warning: #d97706;
    --accent-warning-bg: #fef3c7;
    --accent-danger: #dc2626;
    --accent-danger-bg: #fee2e2;
    --border-color: #e2e8f0; /* Slate 200 */
    --border-sidebar: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --sidebar-width: 260px;
}

[data-theme="dark"] {
    --bg-main: #0f172a; /* Slate 900 */
    --bg-sidebar: #020617; /* Slate 950 */
    --card-bg: #1e293b; /* Slate 800 */
    --primary-color: #10b981;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --border-sidebar: #1e293b;
    --accent-success-bg: rgba(16, 185, 129, 0.2);
    --accent-warning-bg: rgba(217, 119, 6, 0.2);
    --accent-danger-bg: rgba(220, 38, 38, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
}

/* App Layout Grid */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-sidebar);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.sidebar-logo {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.auth-modal-logo {
    height: 60px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    margin: 0 auto 1.5rem;
    display: block;
}

.sidebar-header i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.sidebar-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 2rem;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-sidebar);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.nav-item i {
    font-size: 1.15rem;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-sidebar-active);
}

.nav-item.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.5rem 0;
    border-top: 1px solid var(--border-sidebar);
    font-size: 0.8rem;
    color: #475569;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-main);
}

/* Top Bar */
.top-bar {
    height: 70px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
}

.page-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-title p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.auth-buttons, .user-menu {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.topbar-btn.outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.topbar-btn.outline:hover { background: var(--bg-hover); }

.topbar-btn.primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: var(--bg-main);
}
.topbar-btn.primary:hover { opacity: 0.9; }

.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}
.theme-toggle-btn:hover {
    background: var(--border-color);
}

.mobile-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: auto;
}

.mobile-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
}
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-btn.outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.topbar-btn.outline:hover {
    background: var(--bg-main);
}

.topbar-btn.solid {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #ffffff;
}

.topbar-btn.solid:hover {
    background: var(--primary-hover);
}

.user-email {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2.5rem;
}

.tool-view {
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-out;
}

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

/* Search Box */
.search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    align-items: center;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-left: 0.75rem;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: transparent;
    padding: 0.5rem;
}

.search-box.bulk {
    flex-direction: column;
    padding: 1rem;
    align-items: stretch;
}

.search-box textarea {
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    width: 100%;
    margin-bottom: 1rem;
}

.search-box button {
    padding: 0.75rem 2rem;
    background: var(--text-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

/* Loader */
.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: none;
}
button.loading span { display: none; }
button.loading .loader { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Shared Cards */
.result-card, .multi-result-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

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

.result-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Details and Timeline */
.timeline {
    display: flex;
    justify-content: space-between;
    background: var(--bg-main);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.timeline-item { display: flex; flex-direction: column; gap: 0.25rem; }
.timeline-item .label { color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.timeline-item .value { font-size: 0.95rem; font-weight: 600; }

.countdown {
    text-align: center;
    padding: 2.5rem;
    background: var(--bg-main);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.days-number { font-size: 4rem; font-weight: 800; color: var(--primary-color); line-height: 1; margin-bottom: 0.5rem; }
.days-label { color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.detail-item { display: flex; flex-direction: column; gap: 0.25rem; }
.detail-label { color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase; font-weight: 600; }
.detail-value { font-weight: 500; font-size: 0.95rem; }

/* Status Badges */
.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-badge.available { background: var(--accent-success-bg); color: var(--accent-success); }
.status-badge.danger { background: var(--accent-danger-bg); color: var(--accent-danger); }
.status-badge.warning { background: var(--accent-warning-bg); color: var(--accent-warning); }

/* Advanced Actions */
.advanced-actions-bar {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.action-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    transition: all 0.2s;
}
.action-btn:hover { background: var(--border-color); }
.action-btn.sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

/* Pricing Table Modal */
.pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
}
.pricing-provider {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pricing-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
}
.pricing-buy-btn {
    background: #1e293b;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}
.pricing-buy-btn:hover { background: var(--primary-color); }

/* DNS & Tech */
.dns-section { margin-top: 1.5rem; }
.dns-section h3 { font-size: 1rem; margin-bottom: 1rem; color: var(--text-secondary); }
.dns-grid { display: grid; gap: 0.75rem; }
.dns-item { background: var(--bg-main); padding: 1rem; border-radius: 6px; border: 1px solid var(--border-color); }
.dns-label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 0.4rem; }
.dns-value { font-family: monospace; font-size: 0.85rem; word-break: break-all; }
.tech-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tech-badge { background: #eff6ff; color: var(--primary-color); border: 1px solid #bfdbfe; padding: 0.3rem 0.6rem; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }

/* Multi Grid (Brand/Bulk) */
.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-title-bar h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.action-group { display: flex; gap: 0.5rem; }

.multi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.multi-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.multi-item:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.multi-item .domain-name { font-weight: 600; font-size: 1rem; }
.multi-item .status {
    font-size: 0.7rem; padding: 0.25rem 0.5rem; border-radius: 4px; font-weight: 700; text-transform: uppercase;
}
.multi-item .status.checking { background: #e2e8f0; color: var(--text-secondary); }
.multi-item .status.available { background: var(--accent-success-bg); color: var(--accent-success); }
.multi-item .status.taken { background: var(--accent-danger-bg); color: var(--accent-danger); }
.multi-item .status.warning { background: var(--accent-warning-bg); color: var(--accent-warning); }
.multi-item .status.danger { background: var(--accent-danger-bg); color: var(--accent-danger); }
.multi-item .status.active { background: var(--accent-success-bg); color: var(--accent-success); }

.register-btn {
    width: 100%;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.register-btn:hover { background: var(--bg-main); border-color: #cbd5e1; }

.hidden { display: none !important; }

/* Dashboard Wishlist Header */
.dashboard-header {
    margin-bottom: 2rem;
}
.dashboard-header h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.dashboard-header p { color: var(--text-secondary); font-size: 0.95rem; }

/* Auth Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal-content {
    background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 2.5rem; border-radius: 12px; width: 90%; max-width: 400px;
    position: relative; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease-out;
}
.close-btn, .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.close-btn:hover, .modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: rotate(90deg);
}
.modal-content h2 { text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; }
.modal-content input { width: 100%; margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--border-color); font-family: inherit; font-size: 0.95rem; }
.modal-content input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }
.auth-switch { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.auth-switch a { color: var(--primary-color); font-weight: 600; text-decoration: none; }
.error-message { background: var(--accent-danger-bg); color: var(--accent-danger); padding: 0.75rem; border-radius: 6px; font-size: 0.85rem; text-align: center; margin-bottom: 1rem; }
.success-message { background: var(--accent-success-bg); color: var(--accent-success); padding: 1rem; border-radius: 6px; font-size: 0.95rem; text-align: center; margin-bottom: 1rem; border: 1px solid var(--accent-success); }

/* Home Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}
.feature-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}
.feature-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* AdSense Container */
.adsense-container {
    margin-top: 3rem;
    text-align: center;
    background: var(--bg-main);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.adsense-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    html, body {
        overflow: auto !important;
        height: auto !important;
    }

    .app-layout {
        display: block;
        height: auto !important;
    }
    
    .sidebar {
        position: fixed;
        top: 0; left: -300px;
        width: 260px; height: 100vh;
        z-index: 200;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }

    .hamburger-btn, .mobile-close-btn {
        display: block;
    }

    .main-content {
        width: 100%;
        height: auto !important;
        overflow: visible !important;
    }

    .top-bar {
        padding: 0 1rem;
    }

    .content-area {
        overflow-y: visible !important;
        height: auto !important;
        padding: 1.5rem 1rem;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .timeline {
        flex-direction: column;
        gap: 1rem;
    }

    .advanced-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-btn {
        justify-content: center;
    }
}
