/*
  Complete Website Design Overhaul
  "Monolith" Theme - FINAL & COMPLETE AUDITED VERSION
*/

/* --- Import Google Fonts: Inter for UI, IBM Plex Mono for Data --- */
@import url('https://fonts.googleapis.com/css2?family=Liter&display=swap');

/* --- UPDATED: "Midnight Slate" Color Palette --- */
:root {
    --bg-main: #111827;         /* Dark Slate */
    --surface-color: #1F2937;    /* Lighter Slate */
    --text-primary: #F9FAFB;      /* Brighter Off-White */
    --text-secondary: #9CA3AF;    /* Softer Gray */
    --border-color: #374151;      /* Complements Slate */
    --accent: #22D3EE;            /* Changed to a vibrant Cyan */
    --accent-warm: #FBBF24;        /* Switched to a richer Amber */

    --font-sans: 'Liter', system-ui, sans-serif;
    --font-mono: 'Liter', monospace;
    
    --transition: all 0.2s ease-in-out;
}

/* Base Styles - SHARP CORNERS, NO SHADOWS */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    border-radius: 0 !important;
    box-shadow: none !important;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styles */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-color); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* --- Header & Navigation --- */
.site-navigation {
    padding: 20px 24px;
    position: sticky; top: 0; z-index: 1000;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
}
.nav-container { max-width: 1600px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.nav-logo { display: flex; align-items: center; color: var(--text-primary); text-decoration: none; font-size: 16px; font-weight: 500; letter-spacing: 0.5px; gap: 12px; }
.nav-logo .nav-icon { margin-right: 0; } /* Reset from original */
.nav-links-container { display: flex; align-items: center; }
.nav-links-container a { color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 14px; margin-left: 32px; transition: var(--transition); }
.nav-links-container a:hover { color: var(--text-primary); }

/* Dropdown Menu */
.nav-dropdown { position: relative; }
.dropdown-toggle { display: flex; align-items: center; cursor: default; }
.dropdown-toggle .arrow { font-size: 10px; margin-left: 8px; transition: var(--transition); }
.nav-dropdown:hover .dropdown-toggle .arrow { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute;
    top: 150%; right: 0;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 8px;
    width: 360px;
    z-index: 1001;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    opacity: 0; visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a { color: var(--text-secondary); padding: 8px 12px; text-decoration: none; display: block; text-align: left; font-size: 14px; margin: 0 !important; }
.dropdown-menu a:hover { background-color: var(--surface-color); color: var(--text-primary); }

/* Main Layout & Typography */
.main-container { max-width: 1600px; margin: 0 auto; padding: 64px 24px; }
h1 { font-size: 28px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.5px; }
.gradient-text, .text-accent { color: var(--text-primary); background: none; -webkit-background-clip: unset; -webkit-text-fill-color: unset; }
p.subtitle { margin: 0 0 48px; color: var(--text-secondary); font-size: 16px; max-width: 600px; }
p.subtitle a { color: var(--accent); text-decoration: none; }
p.subtitle a:hover { text-decoration: underline; }

/* Search Box */
.search-container { margin-bottom: 24px; }
.search-box {
    padding: 10px 16px; border: 1px solid var(--border-color);
    font-size: 14px; width: 100%; max-width: 400px;
    background-color: var(--bg-main);
    color: var(--text-primary); transition: var(--transition);
    font-family: var(--font-sans);
}
.search-box::placeholder { color: var(--text-secondary); }
.search-box:focus { outline: none; border-color: var(--accent); }

/* Data Table */
.results-table-wrapper { border: 1px solid var(--border-color); background-color: var(--bg-main); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 18px 24px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
th { background-color: var(--surface-color); font-weight: 500; font-size: 12px; color: var(--text-secondary); letter-spacing: 0.5px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background-color: var(--surface-color); }
.sortable-header { cursor: pointer; user-select: none; }
.sortable-header:hover { background-color: var(--border-color); }
.sort-indicator { margin-left: 8px; }
td:not(:first-child), .tld-price { font-family: var(--font-mono); font-size: 15px; }

/* Tooltip & Price Link */
.price-link { cursor: help; color: var(--text-primary); font-weight: 500; border-bottom: 1px dotted var(--text-secondary); transition: var(--transition); text-decoration: none; }
.price-link:hover { border-bottom-color: var(--text-primary); }
.tooltip-content {
    position: absolute;
    z-index: 9999;
    display: none;
    width: 300px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 16px;
    font-size: 13px;
    transform: translateZ(9999px);
    transition: opacity 0.2s ease-in-out; /* Smooth fade effect */
    user-select: text; /* Allows you to select and copy text */
    cursor: text;      /* Changes cursor to indicate text is selectable */
}
/* --- UPDATED & FIXED --- This makes the tooltip line more subtle */
.tooltip-content hr { 
    border: 0; 
    height: 1px; 
    margin: 8px 0; 
    background: rgba(55, 65, 81, 0.5); /* Lighter, semi-transparent border color */
}

/* Special Cell Styling */
.privacy-free { color: var(--accent); }
.privacy-paid, .rating-stars { color: var(--accent-warm); }
.privacy-unknown, .reviews-unknown { color: var(--text-secondary); }
.trustpilot-link, .registrar-link { color: var(--text-primary); text-decoration: none; }
.trustpilot-link:hover, .registrar-link:hover { text-decoration: underline; }

/* Badge for Best Prices */
.deal-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    margin-left: 8px;
    color: var(--bg-main);
    letter-spacing: 0.5px;
    vertical-align: middle;
    text-transform: uppercase;
}
.deal-badge.best-reg { background-color: var(--accent); }
.deal-badge.best-ren { background-color: var(--accent-warm); }
.deal-badge.best-tra { background-color: #4ade80; } /* A nice green for transfers */

/* --- CORRECTED BUTTONS --- */
.expand-button, .home-button, .submit-button {
    background-color: var(--accent);
    color: var(--bg-main);
    border: 1px solid var(--accent);
    padding: 10px 24px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    text-decoration: none; 
    letter-spacing: 0.5px;
    display: block;
    width: fit-content;
    margin: 32px auto 0 auto;
}

.expand-button:hover, .home-button:hover, .submit-button:hover {
    background-color: var(--surface-color);
    color: var(--accent);
    border-color: var(--surface-color);
}

/* Homepage TLD Grid */
.tld-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.tld-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    transition: var(--transition);
}
.tld-card:hover {
    background-color: var(--border-color);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.tld-name { font-size: 22px; font-weight: 500; color: var(--text-primary); }
.tld-price { font-size: 18px; color: var(--text-secondary); margin-top: 8px; }

/* Pagination */
.pagination { margin: 40px auto; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; user-select: none; }
.pagination a, .pagination span {
    display: flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 14px;
    border: 1px solid var(--border-color);
    text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer;
    background-color: var(--surface-color);
    color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current-page {
    border-color: var(--accent);
    background-color: var(--accent);
    color: var(--bg-main);
    cursor: default;
}
.pagination .ellipsis { border: none; background: transparent; padding: 8px 4px; cursor: default; }

/* All Other Page Styles */

/* Footer */
.site-footer { background-color: var(--surface-color); border-top: 1px solid var(--border-color); padding: 30px 0; text-align: center; margin-top: 60px; }
.footer-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-content p { color: var(--text-secondary); margin: 8px 0; font-size: 14px; }
.footer-note { opacity: 0.7; font-size: 12px !important; }
.heart { color: var(--text-secondary); }
.footer-links { margin-top: 20px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--text-primary); }
.footer-links span { margin: 0 12px; color: var(--border-color); }

/* Legal & Contact Pages */
.legal-container { display: grid; grid-template-columns: 220px 1fr; gap: 48px; max-width: 1100px; margin: 40px auto; align-items: flex-start; }
.legal-sidebar { position: sticky; top: 100px; }
.legal-nav p { font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--text-primary); padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.legal-nav ul { list-style: none; margin-top: 16px; }
.legal-nav ul li a { display: block; color: var(--text-secondary); text-decoration: none; padding: 8px 0; font-size: 14px; transition: var(--transition); border-left: 2px solid transparent; padding-left: 16px; }
.legal-nav ul li a:hover { color: var(--text-primary); border-left: 2px solid var(--accent); }
.legal-content { padding: 0; border: none; background: transparent; }
.legal-content section { margin-bottom: 32px; }
.legal-content h1, .contact-container h1 { font-size: 32px; }
.legal-content h2 { font-size: 22px; margin-top: 32px; margin-bottom: 16px; padding-bottom: 8px; color: var(--text-primary); border-bottom: 1px solid var(--border-color); }
.legal-content p, .disclaimer-box p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; }
.legal-content .last-updated { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }
.disclaimer-box { padding: 20px; border: 1px solid var(--border-color); border-left: 4px solid var(--accent-warm); margin-bottom: 32px; }
.disclaimer-box p { margin: 0; color: var(--accent-warm); }

/* Contact & Settings Forms */
.contact-container, .settings-card { max-width: 800px; margin: 20px auto; border: 1px solid var(--border-color); padding: 32px; background-color: var(--surface-color); }
.contact-container h1, .settings-card h1 { text-align: center; }
.contact-container p.subtitle, .settings-card p.subtitle { text-align: center; }
.contact-card hr { border: none; border-top: 1px solid var(--border-color); margin: 24px 0; }
.contact-email a { color: var(--accent); text-decoration: none; }
.form-group, .contact-form .form-group { margin-bottom: 24px; }
.form-group label, .contact-form label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 14px; color: var(--text-secondary); }
.form-group textarea, .contact-form input, .contact-form textarea { width: 100%; padding: 10px 16px; border: 1px solid var(--border-color); font-size: 14px; font-family: inherit; background: var(--bg-main); color: var(--text-primary); transition: var(--transition); resize: vertical; }
.form-group textarea:focus, .contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.form-group .description { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.success-message { padding: 16px; border: 1px solid var(--accent); color: var(--accent); background: rgba(34, 211, 238, 0.1); text-align: center; margin-bottom: 24px; }

/* 404 Page */
.not-found-container { text-align: center; padding: 60px 20px; border: 1px solid var(--border-color); background-color: var(--surface-color); }
.not-found-container h1 { font-size: 6rem; font-weight: 700; color: var(--text-primary); margin: 0; line-height: 1; font-family: var(--font-mono); }
.not-found-container p { font-size: 1.2rem; color: var(--text-secondary); margin: 16px 0 32px; }

/* Responsive Styles */
@media (max-width: 768px) {
    .main-container { padding: 32px 16px; }
    .tld-grid { 
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
        margin-top: 24px;
    }
    .results-table-wrapper { border: none; background: transparent; }
    table, tbody, tr, td { display: block; }
    table thead { display: none; }
    tr {
        border: 1px solid var(--border-color);
        padding: 16px;
        margin-bottom: 16px;
    }
    td {
        border: none;
        padding: 10px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid var(--border-color);
    }
    td:last-child { border-bottom: none; }
    td:before { content: attr(data-label) ": "; font-weight: 500; color: var(--text-secondary); text-align: left; }
    td:first-child { font-size: 16px; font-weight: 600; }
    td:first-child:before { display: none; } /* Hide label for the first cell */
    .legal-container { grid-template-columns: 1fr; }
    .legal-sidebar { position: static; margin-bottom: 32px; }
}

.usual-price-strikethrough {
    color: var(--text-secondary);
    opacity: 0.7;
    margin-left: 8px;
}

/* Mobile Sorting Controls - Add this section */
.mobile-sort-container {
    display: none;
    margin-bottom: 20px;
}

.mobile-sort-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    width: 100%;
    max-width: 300px;
    transition: var(--transition);
}

.mobile-sort-select:focus {
    outline: none;
    border-color: var(--accent);
}

.mobile-sort-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Update your existing mobile responsive section to include mobile sort */
@media (max-width: 768px) {
    .main-container { padding: 32px 16px; }
    
    /* Show mobile sorting controls - ADD THIS LINE */
    .mobile-sort-container {
        display: block;
    }
    
    .tld-grid { 
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
        margin-top: 24px;
    }
    .results-table-wrapper { border: none; background: transparent; }
    table, tbody, tr, td { display: block; }
    table thead { display: none; }
    tr {
        border: 1px solid var(--border-color);
        padding: 16px;
        margin-bottom: 16px;
    }
    td {
        border: none;
        padding: 10px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid var(--border-color);
    }
    td:last-child { border-bottom: none; }
    td:before { content: attr(data-label) ": "; font-weight: 500; color: var(--text-secondary); text-align: left; }
    td:first-child { font-size: 16px; font-weight: 600; }
    td:first-child:before { display: none; }
    .legal-container { grid-template-columns: 1fr; }
    .legal-sidebar { position: static; margin-bottom: 32px; }
}