/* ========================================
   TAEKWONDO TOURNAMENT SYSTEM - GLOBAL STYLES
   ======================================== */

:root {
    --primary-color: #c41e3a;
    --secondary-color: #003478;
    --accent-color: #ffd700;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

/* ========================================
   GENERAL STYLES
   ======================================== */

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

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: #333;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ========================================
   NAVBAR / HEADER
   ======================================== */

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.5rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand i {
    font-size: 1.8rem;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s;
    margin: 0 5px;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color) !important;
}

.navbar-nav .dropdown-menu {
    background: white;
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
}

.navbar-nav .dropdown-item {
    color: #333;
    transition: all 0.3s;
}

.navbar-nav .dropdown-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    background-color: white;
    border-right: 1px solid var(--border-color);
    min-height: calc(100vh - 70px);
    padding: 20px 0;
    position: sticky;
    top: 70px;
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.sidebar-header h5 {
    color: var(--primary-color);
    font-weight: 900;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link {
    color: #333;
    padding: 12px 20px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
}

.sidebar .nav-link:hover {
    background-color: var(--light-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: rgba(196, 30, 58, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1a1a 100%);
    color: white;
    margin-top: auto;
    padding: 40px 0 20px;
    border-top: 3px solid var(--primary-color);
}

footer h5 {
    color: var(--accent-color);
    font-weight: 900;
    margin-bottom: 15px;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

footer a:hover {
    color: var(--accent-color);
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   CARDS & CONTAINERS
   ======================================== */

.card {
    border: none;
    box-shadow: var(--shadow);
    border-radius: 8px;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #a01830;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

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

.btn-warning {
    background-color: var(--warning-color);
    color: #333;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-info {
    background-color: var(--info-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ========================================
   FORMS
   ======================================== */

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(196, 30, 58, 0.25);
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info-color);
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-success {
    background-color: var(--success-color);
}

.badge-warning {
    background-color: var(--warning-color);
    color: #333;
}

.badge-danger {
    background-color: var(--danger-color);
}

/* ========================================
   TABLES
   ======================================== */

.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.table thead th {
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table tbody td {
    padding: 12px 15px;
    border-color: var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

/* ========================================
   UTILITIES
   ======================================== */

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.shadow-sm {
    box-shadow: var(--shadow) !important;
}

.shadow {
    box-shadow: var(--shadow-lg) !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        top: 0;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    footer {
        padding: 30px 0 15px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* ========================================
   CUSTOM CLASSES
   ======================================== */

.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
    border-radius: 8px;
}

.page-header h1 {
    font-weight: 900;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header h1 i {
    font-size: 2.5rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-card h3 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 900;
    margin: 10px 0;
}

.stat-card p {
    color: #666;
    margin: 0;
    font-weight: 500;
}


/* ========================================
   DRAW SHEET STYLES
   ======================================== */

.draw-sheet {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.draw-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
}

.draw-header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.draw-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 8px;
}

.bracket-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.bracket-round {
    display: inline-block;
    margin-right: 30px;
    vertical-align: top;
}

.round-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.match-box {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 15px;
    background: white;
    min-width: 200px;
}

.match-participant {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.match-participant:last-child {
    border-bottom: none;
}

.match-participant.winner {
    background-color: #d4edda;
    font-weight: bold;
}

.participants-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.participants-list h5 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.participant-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.participant-item:last-child {
    border-bottom: none;
}

.participant-number {
    background-color: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
}

@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .draw-sheet {
        box-shadow: none;
        padding: 0;
    }
}

/* ========================================
   BRACKET STYLES
   ======================================== */

.bracket-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.bracket-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    font-size: 0.9rem;
}

.info-label {
    color: #666;
    font-weight: bold;
}

/* ========================================
   FORM CARD STYLES
   ======================================== */

.form-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.category-table {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ========================================
   BANNER STYLES
   ======================================== */

.banner-item {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

.banner-image {
    height: 150px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-info {
    padding: 15px;
}

/* ========================================
   ORGANIZER CARD STYLES
   ======================================== */

.organizer-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}


/* ========================================
   BANNER PREVIEW & MANAGEMENT
   ======================================== */

.banner-preview {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.banner-item-body {
    padding: 15px;
}

.badge-active {
    background-color: var(--success-color);
}

.badge-inactive {
    background-color: #6c757d;
}


/* ========================================
   HOMEPAGE HERO SECTION
   ======================================== */

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-section .subtitle {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-weight: bold;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-light {
    background-color: white;
    color: var(--primary-color);
    font-weight: bold;
    border: none;
    transition: all 0.3s;
}

.btn-light:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.btn-outline-light {
    border: 2px solid white;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-outline-light:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* ========================================
   CAROUSEL STYLES
   ======================================== */

.carousel-item img {
    height: 500px;
    object-fit: cover;
    border-radius: 8px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--primary-color);
    border-radius: 50%;
    padding: 10px;
}

.carousel-control-prev,
.carousel-control-next {
    opacity: 0.7;
    transition: opacity 0.3s;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.carousel-item {
    height: 500px;
    animation: slideIn 0.5s ease-in-out;
}

/* ========================================
   TOURNAMENT CARD STYLES
   ======================================== */

.tournament-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    height: 100%;
    border-top: 4px solid var(--primary-color);
}

.tournament-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

.tournament-card-img {
    height: 220px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3.5rem;
}

.tournament-card-body {
    padding: 20px;
}

.tournament-card-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.tournament-card-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   POST CARD STYLES
   ======================================== */

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-left: 4px solid var(--primary-color);
}

.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.post-card-img {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
}

.post-card-body {
    padding: 20px;
}

.post-card-body h5 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}

/* ========================================
   SECTION STYLES
   ======================================== */

.section {
    padding: 70px 0;
}

.section.bg-light {
    background-color: #f0f0f0;
}

.section-title {
    color: var(--primary-color);
    font-weight: 900;
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* ========================================
   FEATURE BOX STYLES
   ======================================== */

.feature-box {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-box i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-box h5 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}
