/* ============================================
   Global Stylesheet
   Corporate, Minimalist, Mat Colors
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700&family=Playfair+Display:wght@600;700&display=swap');

:root {
    /* Primary Palette */
    --deep-plum: #4a4e69;
    --muted-violet: #6d597a;
    --dark-berry: #723d46;
    --coral: #e76f51;
    --wine: #502f4c;
    --teal: #005f73;
    --silver-mauve: #9a8c98;
    --soft-purple: #70587c;

    /* Functional Colors */
    --bg-primary: #faf9f7;
    --bg-secondary: #f2f0ed;
    --bg-card: #ffffff;
    --text-primary: #2c2c34;
    --text-secondary: #5c5c6d;
    --text-muted: #8e8e9e;
    --border-light: #e8e6e3;
    --border-medium: #d5d2cd;

    /* Header & Footer */
    --header-bg: #2c2c34;
    --header-text: #f2f0ed;
    --footer-bg: #2c2c34;
    --footer-text: #c5c3be;
    --footer-heading: #f2f0ed;
    --footer-link: #9a8c98;
    --footer-link-hover: #e76f51;

    /* Accent */
    --accent: #005f73;
    --accent-hover: #007a8a;
    --accent-light: rgba(0, 95, 115, 0.08);

    /* Scores */
    --score-high: #2d6a4f;
    --score-mid: #005f73;
    --score-low: #e76f51;
    --score-bad: #723d46;

    /* Typography */
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;

    /* Spacing */
    --header-height: 68px;
    --container-width: 1200px;
    --radius: 8px;
    --radius-lg: 14px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--accent-hover);
}

img { max-width: 100%; height: auto; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: var(--header-bg);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.site-logo img {
    height: 38px;
    width: auto;
}

.site-logo-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--header-text);
    letter-spacing: -0.02em;
}

.site-logo-text span {
    color: var(--coral);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    color: var(--footer-text);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--header-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* ============================================
   HERO / TOP SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--deep-plum) 0%, var(--teal) 100%);
    padding: 48px 0 40px;
    text-align: center;
    color: #fff;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   COUNTRY FLAGS BAR
   ============================================ */
.country-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 0;
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.country-flags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.country-flag-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid transparent;
    border-radius: 40px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-body);
}

.country-flag-btn img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.country-flag-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    transform: translateY(-1px);
}

.country-flag-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 95, 115, 0.3);
}

.country-flag-btn.all-btn {
    background: var(--deep-plum);
    color: #fff;
}

.country-flag-btn.all-btn:hover,
.country-flag-btn.all-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* ============================================
   COUNTRY WARNING
   ============================================ */
.country-warning {
    background: linear-gradient(135deg, #fff3e0, #fff8f0);
    border: 1px solid #f4c27f;
    border-left: 4px solid var(--coral);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 0.88rem;
    color: #5a3e2b;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.country-warning .warn-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============================================
   SITE CARDS LIST
   ============================================ */
.sites-section {
    padding: 32px 0 60px;
    flex: 1;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.site-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.25s ease;
    position: relative;
}

.site-card:hover {
    border-color: var(--border-medium);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.site-card-rank {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--silver-mauve);
    min-width: 36px;
    text-align: center;
}

.site-card-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.site-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.site-card-info {
    flex: 1;
    min-width: 0;
}

.site-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.site-card-name a {
    color: inherit;
}
.site-card-name a:hover {
    color: var(--accent);
}

.site-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.site-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 500;
}

.site-card-scores {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.overall-score {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    position: relative;
}

.overall-score::after {
    content: '/100';
    font-size: 0.55rem;
    font-weight: 400;
    position: absolute;
    bottom: 10px;
    opacity: 0.8;
}

.score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.site-card-action {
    flex-shrink: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 95, 115, 0.25);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

.btn-coral {
    background: var(--coral);
    color: #fff;
}
.btn-coral:hover {
    background: #d4613f;
    color: #fff;
}

.btn-sm {
    padding: 7px 16px;
    font-size: 0.82rem;
}

/* ============================================
   SITE DETAIL PAGE
   ============================================ */
.site-detail-header {
    background: linear-gradient(135deg, var(--deep-plum) 0%, var(--wine) 100%);
    padding: 40px 0;
    color: #fff;
}

.site-detail-top {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-detail-logo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.site-detail-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.site-detail-title h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.site-detail-title .license {
    font-size: 0.9rem;
    opacity: 0.8;
}

.site-detail-title .license strong {
    opacity: 1;
}

.site-detail-body {
    padding: 40px 0 60px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

.detail-main {}

.detail-sidebar {}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.detail-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    color: var(--deep-plum);
}

.scores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.score-item {
    text-align: center;
    padding: 16px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.score-item .score-val {
    font-size: 1.6rem;
    font-weight: 700;
    display: block;
}

.score-item .score-name {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bonus-list, .feature-list, .payment-list {
    list-style: none;
}

.bonus-list li, .feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.92rem;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.bonus-list li::before {
    content: '🎁';
    position: absolute;
    left: 0;
    top: 10px;
    font-size: 0.8rem;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 10px;
    color: var(--score-high);
    font-weight: 700;
}

.bonus-list li:last-child, .feature-list li:last-child {
    border-bottom: none;
}

.payment-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.payment-badge {
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.screenshot-box {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    margin-top: 12px;
}

.screenshot-box img {
    width: 100%;
    display: block;
}

.visit-btn-wrap {
    margin-top: 20px;
}

.visit-btn-wrap .btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

/* Countries served */
.countries-served {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.countries-served img {
    width: 28px;
    height: 19px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ============================================
   ARTICLES
   ============================================ */
.articles-section {
    padding: 40px 0 60px;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.25s ease;
}

.article-card:hover {
    border-color: var(--border-medium);
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.article-card h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.article-card h2 a {
    color: var(--text-primary);
}
.article-card h2 a:hover {
    color: var(--accent);
}

.article-card .excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.article-card .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.article-content {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-content p { margin-bottom: 16px; }
.article-content h2 { font-family: var(--font-heading); font-size: 1.3rem; margin: 28px 0 12px; color: var(--text-primary); }
.article-content h3 { font-size: 1.1rem; margin: 24px 0 10px; color: var(--text-primary); }
.article-content ul, .article-content ol { margin: 12px 0; padding-left: 24px; }
.article-content li { margin-bottom: 8px; }
.article-content img { border-radius: var(--radius); margin: 16px 0; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 48px 0 0;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand .footer-logo img {
    height: 32px;
    width: auto;
}

.footer-brand .footer-logo-text {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--footer-heading);
}

.footer-brand .footer-logo-text span {
    color: var(--coral);
}

.footer-brand p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--footer-text);
    max-width: 280px;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--footer-heading);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--footer-link);
    font-size: 0.88rem;
    transition: color 0.2s ease;
}

.footer-col ul li a:hover {
    color: var(--footer-link-hover);
}

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--footer-link);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    .site-card {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    :root {
        --header-height: 58px;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--header-bg);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .main-nav.open { display: flex; }
    .nav-toggle { display: block; }

    .hero h1 { font-size: 1.5rem; }
    .hero { padding: 32px 0 28px; }

    .country-flag-btn { padding: 6px 10px; font-size: 0.8rem; }
    .country-flag-btn img { width: 20px; height: 14px; }

    .site-card { padding: 16px; gap: 14px; }
    .site-card-rank { font-size: 1.1rem; min-width: 28px; }
    .site-card-logo { width: 56px; height: 56px; }
    .site-card-name { font-size: 1rem; }

    .site-detail-top { flex-direction: column; text-align: center; }
    .site-detail-title h1 { font-size: 1.5rem; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .scores-grid { grid-template-columns: 1fr; }
}

/* ============================================
   ADMIN STYLES (separate from frontend)
   ============================================ */
.admin-body {
    background: var(--bg-secondary);
}

.admin-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 24px;
}

.admin-header {
    background: var(--header-bg);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header a {
    color: var(--footer-link);
    font-size: 0.88rem;
}
.admin-header a:hover {
    color: #fff;
}

.admin-header .admin-title {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
}

.admin-card h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--deep-plum);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: #fff;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group .help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    font-size: 0.88rem;
    cursor: pointer;
}

.checkbox-group label img {
    width: 20px;
    height: 14px;
    border-radius: 2px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}

.admin-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-table tr:hover td {
    background: var(--accent-light);
}

.admin-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #ecf5e7;
    color: #2d6a4f;
    border: 1px solid #c6e0b4;
}

.alert-error {
    background: #fceaea;
    color: #723d46;
    border: 1px solid #f0c5c5;
}

/* Login page */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.login-box h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 24px;
    color: var(--deep-plum);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}
