/* ===== CSS Variables ===== */
:root {
    --primary: #0a3d2f;
    --primary-dark: #052e22;
    --primary-light: #0e5a44;
    --accent: #ffcd3c;
    --accent-dark: #e6b422;
    --gray-light: #f8f9fa;
    --gray: #6c757d;
    --gray-dark: #343a40;
    --white: #ffffff;
    --black: #212529;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    color: var(--black);
    line-height: 1.5;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ===== Header ===== */
header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
header h1 {
    font-size: 1.8rem;
}
header h1 a {
    color: var(--white);
    text-decoration: none;
}
nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
nav a, nav button {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 40px;
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}
nav a:hover, nav button:hover {
    background: rgba(255,255,255,0.1);
}
nav .subscribe-btn {
    background: var(--accent);
    color: var(--primary);
    padding: 0.5rem 1rem;
}
nav .subscribe-btn:hover {
    background: var(--accent-dark);
}

/* ===== Main Container ===== */
.content-container {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* ===== Cards ===== */
.tip-card, .stat-card, .bookmaker-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.tip-card:hover, .stat-card:hover, .bookmaker-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.tip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.tip-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}
.tip-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--gray);
}
.price-badge {
    background: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 40px;
    font-weight: bold;
    color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.btn:hover {
    background: var(--primary-dark);
}
.btn-secondary {
    background: var(--accent);
    color: var(--primary);
}
.btn-secondary:hover {
    background: var(--accent-dark);
}
.btn-danger {
    background: #dc3545;
}
.btn-danger:hover {
    background: #c82333;
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}
/* User Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}
.user-name {
    background: none;
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 1rem;
}
.user-name:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 40px;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    z-index: 1000;
    margin-top: 0.5rem;
}
.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--black);
    text-decoration: none;
    transition: background 0.2s;
}
.dropdown-menu a:hover {
    background: var(--gray-light);
}
.user-dropdown:hover .dropdown-menu {
    display: block;
}
/* ===== Forms & Auth ===== */
.auth-container {
    max-width: 500px;
    margin: 2rem auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}
.role-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
}
.role-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    font-weight: bold;
    color: var(--gray);
    text-decoration: none;
}
.role-tab.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10,61,47,0.1);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.stat-card {
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

/* ===== Tables ===== */
.data-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.data-table th {
    background: var(--gray-light);
    font-weight: 600;
}

/* ===== Modals ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    overflow-y: auto;
}
.modal-content {
    background: var(--white);
    max-width: 1000px;
    margin: 3rem auto;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray);
}
.bookmaker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.bookmaker-card {
    text-align: center;
    padding: 1rem;
}
.odds-row {
    display: flex;
    justify-content: space-around;
    margin: 0.8rem 0;
    font-weight: bold;
}
.user-dropdown {
    position: relative;
    display: inline-block;
}
.user-name {
    background: none;
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 1rem;
}
.user-name:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 40px;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 12px;
    overflow: hidden;
    z-index: 1000;
    margin-top: 0.5rem;
}
.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #212529;
    text-decoration: none;
    transition: background 0.2s;
}
.dropdown-menu a:hover {
    background: #f8f9fa;
}
.dropdown-menu.show {
    display: block;
}

/* ===== Welcome Card ===== */
.welcome-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}
.welcome-card h2 {
    margin-bottom: 0.5rem;
}
.welcome-card .btn {
    margin-top: 1rem;
}

/* ===== Flash Messages ===== */
.flash-message {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    text-align: center;
}
.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.error {
    background: #ffe0e0;
    color: #c00;
    border: 1px solid #f5c6cb;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    font-size: 0.85rem;
    border-top: 1px solid #ddd;
    margin-top: 3rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    nav {
        justify-content: center;
    }
    .content-container {
        padding: 0 1rem;
    }
    .tip-grid {
        grid-template-columns: 1fr;
    }
}