/* === Theme definitions === */
:root,
[data-theme="light"] {
    --bg-body: #f0f4f0;
    --bg-navbar: #1a3a1a;
    --bg-card: #fff;
    --bg-input: #fff;
    --text-primary: #2d3b2d;
    --text-heading: #1a3a1a;
    --text-nav: #d4e8d4;
    --text-nav-hover: #81c784;
    --text-meta: #5a6e5a;
    --text-username: #7a917a;
    --color-accent: #2e7d32;
    --color-accent-hover: #1b5e20;
    --color-secondary: #43a047;
    --color-secondary-hover: #2e7d32;
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-warning: #f59e0b;
    --color-warning-hover: #d97706;
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --border-input: #b8ccb8;
    --border-card: rgba(46, 125, 50, 0.1);
    --shadow-card: rgba(46, 125, 50, 0.08);
    --shadow-card-hover: rgba(46, 125, 50, 0.18);
    --gradient-accent: linear-gradient(135deg, #2e7d32, #43a047);
    --gradient-hero: linear-gradient(135deg, #1a3a1a 0%, #2e7d32 40%, #43a047 100%);
    --flash-bg: #d1fae5;
    --flash-color: #065f46;
    --flash-border: #a7f3d0;
    --flash-error-bg: #fee2e2;
    --flash-error-color: #991b1b;
    --flash-error-border: #fca5a5;
    --navbar-accent-line: linear-gradient(90deg, #1b5e20, #2e7d32, #43a047, #81c784);
}

[data-theme="dark"] {
    --bg-body: #0d1a0d;
    --bg-navbar: #1a2e1a;
    --bg-card: #1a2e1a;
    --bg-input: #253825;
    --text-primary: #d4e8d4;
    --text-heading: #a5d6a7;
    --text-nav: #b8ccb8;
    --text-nav-hover: #81c784;
    --text-meta: #7a917a;
    --text-username: #5a6e5a;
    --color-accent: #66bb6a;
    --color-accent-hover: #4caf50;
    --color-secondary: #81c784;
    --color-secondary-hover: #66bb6a;
    --color-success: #34d399;
    --color-success-hover: #10b981;
    --color-warning: #fbbf24;
    --color-warning-hover: #f59e0b;
    --color-danger: #f87171;
    --color-danger-hover: #ef4444;
    --border-input: #3a5c3a;
    --border-card: rgba(102, 187, 106, 0.12);
    --shadow-card: rgba(0, 0, 0, 0.3);
    --shadow-card-hover: rgba(102, 187, 106, 0.2);
    --gradient-accent: linear-gradient(135deg, #66bb6a, #81c784);
    --gradient-hero: linear-gradient(135deg, #0d1a0d 0%, #1b5e20 40%, #2e7d32 100%);
    --flash-bg: #064e3b;
    --flash-color: #6ee7b7;
    --flash-border: #065f46;
    --flash-error-bg: #450a0a;
    --flash-error-color: #fca5a5;
    --flash-error-border: #7f1d1d;
    --navbar-accent-line: linear-gradient(90deg, #66bb6a, #81c784, #a5d6a7, #c8e6c9);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    transition: background 0.3s, color 0.3s;
}

/* === Navbar === */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-navbar);
    color: #fff;
    padding: 1rem 2rem;
    position: relative;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--navbar-accent-line);
}

.navbar .logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient-accent);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.logo-text {
    letter-spacing: -0.02em;
}

.logo-highlight {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.footer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--gradient-accent);
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-nav);
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.3rem 0;
    position: relative;
    transition: color 0.2s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--text-nav-hover);
}

.user-name {
    margin-right: 0.5rem;
    color: var(--text-username);
}

/* === Theme Switcher === */
.theme-switcher {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-nav);
    padding: 0.35rem 0.6rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 1rem;
    transition: background 0.2s, border-color 0.2s;
    line-height: 1;
}

.theme-switcher:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
    display: none;
}

.theme-icon-light,
.theme-icon-dark {
    display: inline;
}

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

h1 {
    margin-bottom: 1.5rem;
    color: var(--text-heading);
}

/* === Flash messages === */
.flash {
    padding: 0.8rem 1.2rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: var(--flash-bg);
    color: var(--flash-color);
    border: 1px solid var(--flash-border);
    font-weight: 500;
}

.flash.error {
    background: var(--flash-error-bg);
    color: var(--flash-error-color);
    border-color: var(--flash-error-border);
}

/* === Page list === */
.page-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-card);
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
    position: relative;
    border: 1px solid var(--border-card);
    border-left: 4px solid var(--color-accent);
}

.page-item:hover {
    box-shadow: 0 4px 16px var(--shadow-card-hover);
    transform: translateY(-1px);
}

.drag-handle {
    cursor: grab;
    font-size: 1.2rem;
    color: var(--text-meta);
    position: absolute;
    top: 1rem;
    right: 1rem;
    user-select: none;
}

.drag-handle:hover {
    color: var(--color-accent);
}

.page-item.sortable-ghost {
    opacity: 0.4;
}

.page-item.sortable-chosen {
    box-shadow: 0 4px 12px var(--shadow-card);
}

.page-item h2 a {
    color: var(--text-heading);
    text-decoration: none;
}

.page-item h2 a:hover {
    color: var(--color-accent);
}

.meta {
    color: var(--text-meta);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.actions {
    margin-top: 0.8rem;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.55rem 1.3rem;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(46, 125, 50, 0.2);
}

.btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-gradient {
    background: var(--gradient-accent);
    border: none;
}

.btn-gradient:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* === Forms === */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-card);
    border: 1px solid var(--border-card);
}

form label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    color: var(--text-heading);
}

form input[type="text"],
form input[type="password"],
form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

form textarea {
    min-height: 200px;
    resize: vertical;
}

form input[type="submit"] {
    padding: 0.7rem 2rem;
    background: var(--gradient-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

form input[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.4);
}

form .error {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* === Page content === */
.page-content {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-card);
    box-shadow: 0 2px 8px var(--shadow-card);
}

article a {
    color: var(--color-accent);
    margin-top: 1rem;
    display: inline-block;
}

/* === Frontend layout === */
body.front {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.front .container {
    flex: 1;
    max-width: 1140px;
}

/* === Hamburger Menu === */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-nav);
    transition: transform 0.3s, opacity 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-navbar);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 0;
        z-index: 100;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        margin-left: 0;
        padding: 0.6rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links .theme-switcher {
        margin-left: 0;
        margin-top: 0.5rem;
        align-self: flex-start;
    }
}

/* === Footer === */
.site-footer {
    background: var(--bg-navbar);
    color: var(--text-nav);
    padding: 1.2rem 2rem;
    margin-top: 2rem;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--navbar-accent-line);
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-recommend {
    max-width: 900px;
    margin: 0 auto 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-recommend-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.7rem;
    color: var(--text-nav);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-recommend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.2rem;
}

.footer-recommend-list li {
    margin: 0;
}

.footer-recommend-list a {
    font-size: 0.85rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.site-footer a {
    color: var(--text-nav);
    text-decoration: none;
    opacity: 0.7;
    font-size: 0.85rem;
}

.site-footer a:hover {
    opacity: 1;
    color: var(--text-nav-hover);
}

/* === Status badges === */
.status-badge {
    display: inline-block;
    font-size: 0.65em;
    font-weight: 600;
    padding: 0.2em 0.6em;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-active {
    background: var(--color-success);
    color: #fff;
}

.status-inactive {
    background: var(--text-meta);
    color: #fff;
}

.page-item.is-inactive {
    opacity: 0.6;
    border-left-color: var(--text-meta);
}

.btn-toggle-on {
    background: var(--color-success);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-toggle-on:hover {
    background: var(--color-success-hover);
}

.btn-toggle-off {
    background: var(--text-meta);
}

.btn-toggle-off:hover {
    background: var(--color-warning);
}

/* === Cookie Consent Bar === */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-navbar);
    color: var(--text-nav);
    padding: 1rem 2rem;
    z-index: 9999;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
}

.cookie-consent-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.cookie-consent-text {
    font-size: 0.9rem;
}

.cookie-consent-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .cookie-consent-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* === Hero section === */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    background: var(--gradient-hero);
    border-radius: 14px;
    color: #fff;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* === Selection color === */
::selection {
    background: rgba(46, 125, 50, 0.25);
    color: inherit;
}

/* === Scrollbar (webkit) === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

/* === Heading accent === */
h1 {
    position: relative;
    padding-bottom: 0.5rem;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.hero h1::after {
    display: none;
}

/* === Active page link in nav === */
.nav-page-link.active {
    color: var(--text-nav-hover) !important;
    font-weight: 600;
}

/* === Admin navbar label === */
.navbar-admin .logo small {
    font-size: 0.6em;
    opacity: 0.6;
    font-weight: normal;
}

/* === Gallery Grid (Admin & Frontend) === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-grid-item {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    box-shadow: 0 2px 8px var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-card-hover);
}

.gallery-grid-front .gallery-grid-item {
    cursor: pointer;
}

.gallery-grid-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    color: var(--text-meta);
}

.gallery-photo-actions {
    padding: 0.4rem 0.7rem 0.7rem;
}

/* === Gallery Card List (Frontend) === */
.gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.gallery-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    box-shadow: 0 2px 8px var(--shadow-card);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow-card-hover);
}

.gallery-card-thumb {
    height: 200px;
    overflow: hidden;
}

.gallery-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    color: var(--text-meta);
    font-size: 0.9rem;
}

.gallery-card-info {
    padding: 1rem;
}

.gallery-card-info h2,
.gallery-card-info h3 {
    margin-bottom: 0.3rem;
    color: var(--text-heading);
    font-size: 1.1rem;
}

.gallery-card-info h2::after,
.gallery-card-info h3::after {
    display: none;
}

.gallery-card-info p {
    font-size: 0.9rem;
    color: var(--text-meta);
    margin-bottom: 0.3rem;
}

.photo-count-badge {
    display: inline-block;
    font-size: 0.65em;
    font-weight: 600;
    padding: 0.2em 0.6em;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 0.5rem;
    background: var(--color-secondary);
    color: #fff;
}

/* === Page galleries section === */
.page-galleries {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-card);
}

.page-galleries h2::after {
    display: none;
}

/* === Lightbox === */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-caption {
    color: #fff;
    margin-top: 1rem;
    font-size: 0.95rem;
    text-align: center;
    opacity: 0.8;
}

/* === Match Widget (Homepage) === */
.match-widget {
    margin-top: 2rem;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid var(--border-card);
    box-shadow: 0 2px 12px var(--shadow-card);
}

.match-widget-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-heading);
}

.match-widget-title::after {
    display: none;
}

.match-widget-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .match-widget-cards {
        grid-template-columns: 1fr;
    }
}

.match-widget-card {
    background: var(--bg-body);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    border: 1px solid var(--border-card);
}

.match-widget-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-meta);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.match-widget-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.match-widget-team {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 1rem;
}

.match-widget-score {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.match-widget-vs {
    font-size: 1rem;
    color: var(--text-meta);
    font-weight: 600;
}

.match-widget-meta {
    font-size: 0.8rem;
    color: var(--text-meta);
}

.match-widget-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.match-widget-link:hover {
    text-decoration: underline;
}

/* === Match Tabs === */
.match-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-card);
}

.match-tab {
    padding: 0.7rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-meta);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.match-tab:hover {
    color: var(--text-heading);
}

.match-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.match-tab-content {
    display: none;
}

.match-tab-content.active {
    display: block;
}

/* === Match Highlight === */
.match-highlight {
    background: var(--gradient-hero);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    color: #fff;
    margin-bottom: 1.5rem;
}

.match-highlight-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.8;
    margin-bottom: 0.6rem;
}

.match-highlight-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.match-highlight-team {
    font-size: 1.1rem;
    font-weight: 600;
}

.match-highlight-result {
    font-size: 2.2rem;
    font-weight: 800;
}

.match-highlight-meta {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* === Match Upcoming Preview === */
.match-upcoming-preview {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-card);
    box-shadow: 0 2px 8px var(--shadow-card);
}

.match-upcoming-preview h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--text-heading);
}

.match-upcoming-preview h3::after {
    display: none;
}

/* === Match Filters === */
.match-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.match-filter {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.match-filter:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.match-filter.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* === Match List Rows === */
.match-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-card);
    transition: background 0.2s;
    flex-wrap: wrap;
}

.match-row:hover {
    box-shadow: 0 2px 8px var(--shadow-card);
}

.match-date {
    font-size: 0.85rem;
    color: var(--text-meta);
    min-width: 100px;
}

.match-teams {
    flex: 1;
    font-size: 0.95rem;
}

.match-score {
    font-weight: 700;
    font-size: 1rem;
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
}

.match-result-win {
    background: var(--color-success);
    color: #fff;
}

.match-result-loss {
    background: var(--color-danger);
    color: #fff;
}

.match-result-draw {
    background: var(--color-warning);
    color: #fff;
}

.match-location {
    font-size: 0.8rem;
    color: var(--text-meta);
}

.match-desc {
    font-size: 0.8rem;
    color: var(--text-meta);
    font-style: italic;
    width: 100%;
}

.match-hidden {
    display: none;
}

.match-expand-btn {
    margin-top: 0.8rem;
}

/* === Match admin status badge === */
.status-upcoming {
    background: var(--color-secondary);
    color: #fff;
}

/* === Upload form styling === */
.upload-section {
    background: var(--bg-card);
    padding: 1.2rem;
    border-radius: 10px;
    border: 1px solid var(--border-card);
}

form input[type="file"] {
    width: 100%;
    padding: 0.6rem 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* === News Widget (homepage) === */
.news-widget {
    margin-top: 2rem;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid var(--border-card);
    box-shadow: 0 2px 12px var(--shadow-card);
}

.news-widget-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-heading);
}

.news-widget-title::after {
    display: none;
}

.news-widget-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .news-widget-cards {
        grid-template-columns: 1fr;
    }
}

.news-widget-card {
    background: var(--bg-body);
    border-radius: 10px;
    padding: 1.2rem;
    border: 1px solid var(--border-card);
}

.news-widget-date {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-meta);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.news-widget-card-title {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: var(--text-heading);
}

.news-widget-card-title a {
    color: inherit;
    text-decoration: none;
}

.news-widget-card-title a:hover {
    color: var(--color-accent);
}

.news-widget-perex {
    font-size: 0.85rem;
    color: var(--text-meta);
    line-height: 1.4;
    margin: 0;
}

.news-widget-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.news-widget-link:hover {
    text-decoration: underline;
}

/* === News List (frontend) === */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.news-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-card);
    box-shadow: 0 2px 8px var(--shadow-card);
    transition: box-shadow 0.2s;
}

.news-card:hover {
    box-shadow: 0 4px 16px var(--shadow-card-hover);
}

.news-card-date {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-meta);
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.news-card-title {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
    color: var(--text-heading);
}

.news-card-title a {
    color: inherit;
    text-decoration: none;
}

.news-card-title a:hover {
    color: var(--color-accent);
}

.news-card-perex {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.news-card-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.news-card-link:hover {
    text-decoration: underline;
}

/* === News Detail (frontend) === */
.news-detail {
    margin-bottom: 2rem;
}

.news-detail-date {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-meta);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.news-detail-perex {
    font-size: 1.05rem;
    color: var(--text-meta);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.news-detail-content {
    line-height: 1.7;
    color: var(--text-primary);
}

/* === Homepage Banner === */
.hp-banner {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    min-height: 420px;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hp-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="g" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect fill="url(%23g)" width="100" height="100"/></svg>');
    pointer-events: none;
}

.hp-banner-overlay {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.hp-banner-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
}

.hp-banner-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hp-banner-title::after {
    display: none;
}

.hp-banner-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hp-banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    backdrop-filter: blur(4px);
}

.hp-banner-arrow:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.hp-banner-prev { left: 1.5rem; }
.hp-banner-next { right: 1.5rem; }

/* === Homepage Sections (3-column) === */
.hp-sections {
    display: grid;
    grid-template-columns: 1fr 1.3fr 0.8fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.hp-section {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid var(--border-card);
    box-shadow: 0 2px 12px var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.hp-section-title {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--text-heading);
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--border-card);
}

.hp-section-title::after {
    display: none;
}

.hp-subsection-title {
    font-size: 0.9rem;
    color: var(--text-meta);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 1rem 0 0.6rem;
    font-weight: 600;
}

.hp-subsection-title::after {
    display: none;
}

.hp-section-link {
    display: inline-block;
    margin-top: auto;
    padding-top: 1rem;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.hp-section-link:hover {
    text-decoration: underline;
}

.hp-empty {
    color: var(--text-meta);
    font-size: 0.9rem;
    font-style: italic;
}

/* HP News items */
.hp-news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hp-news-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-card);
}

.hp-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hp-news-date {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-meta);
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.hp-news-item-title {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: var(--text-heading);
}

.hp-news-item-title::after {
    display: none;
}

.hp-news-item-title a {
    color: inherit;
    text-decoration: none;
}

.hp-news-item-title a:hover {
    color: var(--color-accent);
}

.hp-news-perex {
    font-size: 0.82rem;
    color: var(--text-meta);
    line-height: 1.4;
    margin: 0;
}

/* HP Next Match */
.hp-next-match {
    background: var(--gradient-hero);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    color: #fff;
}

.hp-next-match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.hp-next-match-team {
    font-weight: 700;
    font-size: 1rem;
}

.hp-next-match-vs {
    font-size: 0.85rem;
    opacity: 0.7;
    font-weight: 600;
}

.hp-next-match-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.hp-next-match-date {
    font-weight: 600;
}

.hp-next-match-location {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 0.3rem;
}

/* HP Match History */
.hp-match-history {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hp-match-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    background: var(--bg-body);
    font-size: 0.82rem;
}

.hp-match-row-date {
    color: var(--text-meta);
    min-width: 75px;
    font-size: 0.75rem;
}

.hp-match-row-teams {
    flex: 1;
    color: var(--text-primary);
}

.hp-match-row-score {
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.hp-result-win {
    background: var(--color-success);
    color: #fff;
}

.hp-result-loss {
    background: var(--color-danger);
    color: #fff;
}

.hp-result-draw {
    background: var(--color-warning);
    color: #fff;
}

/* HP Stats Table */
.hp-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.hp-stats-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border-card);
}

.hp-stats-table tr:last-child td {
    border-bottom: none;
}

.hp-stats-label {
    color: var(--text-meta);
    font-size: 0.85rem;
}

.hp-stats-value {
    text-align: right;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-heading);
}

.hp-stats-points {
    background: var(--bg-body);
    border-radius: 6px;
}

.hp-stats-points .hp-stats-label {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 0.95rem;
}

.hp-stats-points .hp-stats-value {
    font-size: 1.3rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* HP Page Content */
.hp-page-content {
    margin-top: 1rem;
}

/* === Responsive adjustments === */
@media (max-width: 900px) {
    .hp-sections {
        grid-template-columns: 1fr 1fr;
    }

    .hp-section-table {
        grid-column: 1 / -1;
    }

    .hp-banner {
        min-height: 320px;
    }

    .hp-banner-title {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .hp-sections {
        grid-template-columns: 1fr;
    }

    .hp-banner {
        min-height: 260px;
    }

    .hp-banner-title {
        font-size: 1.6rem;
    }

    .hp-banner-badge {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }

    .hp-banner-arrow {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .gallery-list {
        grid-template-columns: 1fr;
    }

    .match-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .match-highlight-score {
        flex-direction: column;
        gap: 0.4rem;
    }
}

/* === Info Bar (under navbar) === */
.info-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-card);
    box-shadow: 0 2px 6px var(--shadow-card);
    color: var(--text-primary);
}

.info-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.55rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.info-bar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.2;
}

.info-bar-label {
    font-weight: 600;
    color: var(--text-meta);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.info-bar-value {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.info-bar-teams {
    font-weight: 600;
    color: var(--text-heading);
}

.info-bar-date {
    font-weight: 700;
    color: var(--color-accent);
}

.info-bar-score {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    background: var(--bg-input);
}

.info-bar-empty {
    color: var(--text-meta);
    font-style: italic;
}

.info-bar-fb {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #1877f2;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.info-bar-fb:hover {
    background: rgba(24, 119, 242, 0.1);
    transform: translateY(-1px);
}

[data-theme="dark"] .info-bar-fb {
    color: #4f9bff;
}

[data-theme="dark"] .info-bar-fb:hover {
    background: rgba(79, 155, 255, 0.15);
}

@media (max-width: 768px) {
    .info-bar-inner {
        padding: 0.5rem 1rem;
        gap: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .info-bar-fb {
        margin-left: 0;
        align-self: flex-end;
    }

    .info-bar-item {
        flex-wrap: wrap;
    }
}
}
