/**
 * Wrestling King of Sports - Main Stylesheet
 * Modern, responsive design with wrestling theme
 */

/* ============================================
   CSS Variables / Theme
   ============================================ */
:root {
    --primary-color: #c9a227;
    --secondary-color: #1a1a2e;
    --accent-color: #e63946;
    --dark-bg: #0f0f1a;
    --light-text: #f8f9fa;
    --muted-text: #d1d5db;
    --card-bg: #1a1a2e;
    --border-color: #2d2d44;
    --gold: #ffd700;
    --ring-red: #b22234;
    --success: #28a745;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--gold);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.brand-text {
    background: linear-gradient(90deg, var(--gold), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(201, 162, 39, 0.2);
    color: var(--gold) !important;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    background: linear-gradient(135deg, rgba(15, 15, 26, 0.95), rgba(26, 26, 46, 0.9)),
                url('../images/hero-bg.jpg') center/cover;
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/ring-ropes.png') repeat-x bottom;
    opacity: 0.1;
}

.hero-title {
    font-size: 4rem;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 var(--ring-red), 6px 6px 0 rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--muted-text);
    margin-bottom: 2rem;
}

.hero .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--gold));
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero .btn-outline-light {
    border-width: 2px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   Carousel
   ============================================ */
.carousel-section {
    background: var(--card-bg);
    padding: 3rem 0;
}

.carousel {
    max-width: 600px;
    margin: 0 auto;
}

.carousel-inner {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.carousel-item img {
    width: 100%;
    height: 600px;
    object-fit: contain;
    background: #111;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
}

.carousel-control-prev {
    left: -25px;
}

.carousel-control-next {
    right: -25px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: var(--gold);
    opacity: 1;
}

.carousel-indicators {
    margin-bottom: -2rem;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--muted-text);
    opacity: 0.5;
}

.carousel-indicators button.active {
    background-color: var(--gold);
    opacity: 1;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.card-img-top {
    height: 300px;
    object-fit: cover;
    border-bottom: 3px solid var(--primary-color);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--gold);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--muted-text);
}

/* Ensure good contrast for text on light backgrounds */
.bg-warning .text-dark,
.badge.bg-warning {
    color: #000 !important;
}

.badge.bg-secondary {
    background-color: #4a5568 !important;
    color: #fff !important;
}

/* Wrestler Card */
.wrestler-card {
    position: relative;
}

.wrestler-card .card-img-overlay {
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.wrestler-card .wrestler-name {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.wrestler-card .match-count {
    color: var(--muted-text);
    font-size: 0.9rem;
}

/* ============================================
   Gallery Grid
   ============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 50%, rgba(0,0,0,0.9));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.gallery-item .overlay-content {
    color: white;
}

.gallery-item .overlay-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.gallery-item .overlay-date {
    font-size: 0.85rem;
    color: var(--primary-color);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--gold);
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--ring-red), var(--primary-color));
    border-radius: 2px;
}

.section-subtitle {
    color: var(--muted-text);
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* ============================================
   Stats Section
   ============================================ */
.stats-section {
    background: linear-gradient(135deg, var(--secondary-color), var(--dark-bg));
    padding: 4rem 0;
}

.stat-item {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem;
    color: var(--gold);
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--muted-text);
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

/* ============================================
   Forms
   ============================================ */
.form-control,
.form-select {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--light-text);
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--light-text);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

.form-control::placeholder {
    color: var(--muted-text);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #b8941f);
    border: none;
    color: #000;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold), var(--primary-color));
    color: #000;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
}

.btn-warning {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
    font-weight: 600;
}

.btn-warning:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   Tables
   ============================================ */
.table {
    --bs-table-bg: var(--card-bg);
    --bs-table-color: var(--light-text);
    --bs-table-border-color: var(--border-color);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color), #b8941f);
    color: #000;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border: none;
}

.table tbody tr:hover {
    background-color: rgba(201, 162, 39, 0.1);
}

/* ============================================
   Pagination
   ============================================ */
.pagination .page-link {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--light-text);
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
}

.pagination .page-item.active .page-link {
    background-color: var(--gold);
    border-color: var(--gold);
    color: #000;
}

.pagination .page-item.disabled .page-link {
    background-color: var(--card-bg);
    color: #9ca3af;
    opacity: 0.6;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: linear-gradient(180deg, var(--secondary-color), var(--dark-bg));
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #e5e7eb;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--gold);
    padding-left: 5px;
}

.social-links a {
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--gold) !important;
}

/* ============================================
   Back to Top Button
   ============================================ */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#backToTop.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ============================================
   Lightbox / Modal
   ============================================ */
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.btn-close {
    filter: invert(1);
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumb {
    background: transparent;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--light-text);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--muted-text);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--gold);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-gold { color: var(--gold) !important; }
.text-primary { color: var(--primary-color) !important; }
.text-ring-red { color: var(--ring-red) !important; }
.bg-dark-custom { background-color: var(--dark-bg) !important; }
.bg-card { background-color: var(--card-bg) !important; }
.border-gold { border-color: var(--gold) !important; }

/* Improved contrast for muted text on dark backgrounds */
.bg-dark .text-muted,
.bg-card .text-muted,
.card .text-muted {
    color: var(--muted-text) !important;
}

/* Ensure light text on dark sections */
.bg-dark .lead,
.bg-dark p:not(.text-gold):not(.text-primary) {
    color: var(--light-text);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 3rem;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .hero {
        min-height: 60vh;
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .gallery-item img {
        height: 280px;
    }
    
    .carousel-item img {
        height: 400px;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.75rem;
        text-shadow: 2px 2px 0 var(--ring-red);
    }
    
    .hero .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .card-img-top {
        height: 200px;
    }
}

/* ============================================
   Lazy Loading Styles
   ============================================ */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.lazy-loaded {
    opacity: 1;
}

/* Loading placeholder background */
.gallery-item img[data-src],
.card-img-top[data-src],
.wrestler-card img[data-src] {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--secondary-color) 100%);
    min-height: 200px;
}

/* Skeleton loading animation for images not yet loaded */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

img[data-src]:not(.lazy-loaded) {
    background: linear-gradient(90deg, 
        var(--card-bg) 25%, 
        var(--secondary-color) 50%, 
        var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar,
    .footer,
    #backToTop,
    .btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
