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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0e27;
    color: #fff;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: #1a1f3a;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 2em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s;
    padding: 8px 15px;
    border-radius: 5px;
}

.nav-menu a:hover, .nav-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 0;
    text-align: center;
}

header h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 30px auto 0;
}

#searchInput {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 50px;
    background: rgba(255,255,255,0.95);
    color: #333;
    outline: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

#searchInput::placeholder {
    color: #666;
}

main {
    padding: 40px 20px;
}

h2 {
    margin-bottom: 30px;
    font-size: 2em;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.match-card {
    background: #1a1f3a;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.match-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.match-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.match-info {
    padding: 20px;
}

.live-badge {
    background: #ff0000;
    color: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.duration-badge {
    background: #667eea;
    color: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.duration-badge-small {
    background: #667eea;
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 8px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.match-info h3 {
    font-size: 1.4em;
    margin: 10px 0;
}

.league {
    color: #a0a0a0;
    font-size: 1em;
}

.views {
    color: #667eea;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Watch Page */
.watch-page {
    max-width: 100%;
    padding: 0;
}

.watch-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 50px;
}

.stream-section {
    width: 100%;
}

.stream-container {
    margin-bottom: 50px;
}

.video-player {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px);
    overflow: hidden;
    background: #000;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.team-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    padding: 15px;
    pointer-events: none;
}

.team-btn {
    background: rgba(26, 31, 58, 0.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1em;
    backdrop-filter: blur(10px);
    border: 2px solid #667eea;
}

.team-left {
    border-color: #667eea;
}

.team-right {
    border-color: #764ba2;
}

.score-overlay {
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    backdrop-filter: blur(10px);
}

.score-status {
    font-size: 0.6em;
    color: #ff4444;
    font-weight: bold;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.below-player {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.below-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

.match-details {
    background: #1a1f3a;
    padding: 30px;
    border-radius: 15px;
}

/* Vote Section */
.vote-section {
    background: #1a1f3a;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.vote-section h3 {
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
}

.vote-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.vote-btn {
    background: #0a0e27;
    border: 2px solid #667eea;
    color: #fff;
    padding: 20px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vote-btn:hover {
    background: #667eea;
    transform: translateY(-3px);
}

.vote-btn.voted {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #764ba2;
}

.vote-btn .team-name {
    font-weight: bold;
    font-size: 1em;
}

.vote-btn .vote-count {
    font-size: 1.5em;
    font-weight: bold;
    color: #00ff88;
}

.match-details h2 {
    margin: 15px 0 25px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.detail-item {
    background: #0a0e27;
    padding: 15px;
    border-radius: 10px;
}

.detail-label {
    display: block;
    color: #a0a0a0;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.detail-value {
    display: block;
    font-size: 1.1em;
    font-weight: bold;
}

/* Related Matches */
.related-section {
    margin-top: 50px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.related-card {
    background: #1a1f3a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.related-card:hover {
    transform: scale(1.05);
}

.related-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.related-info {
    padding: 15px;
}

.live-badge-small {
    background: #ff0000;
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 8px;
}

.related-info h4 {
    font-size: 1.1em;
    margin: 8px 0;
}

.related-info p {
    color: #a0a0a0;
    font-size: 0.9em;
}

/* Comments Section */
.comments-section {
    background: #1a1f3a;
    border-radius: 15px;
    padding: 20px;
    height: fit-content;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.comments-section h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

#commentsBox {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    min-height: 400px;
    max-height: calc(85vh - 200px);
    padding-right: 10px;
}

#commentsBox::-webkit-scrollbar {
    width: 6px;
}

#commentsBox::-webkit-scrollbar-track {
    background: #0a0e27;
    border-radius: 10px;
}

#commentsBox::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.comment {
    background: #0a0e27;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.comment strong {
    color: #667eea;
    font-size: 0.95em;
}

.comment-time {
    color: #666;
    font-size: 0.75em;
    margin-left: 8px;
}

.comment p {
    margin-top: 5px;
    font-size: 0.95em;
    line-height: 1.4;
}

#commentForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#commentInput {
    width: 100%;
    padding: 10px;
    background: #0a0e27;
    border: 2px solid #667eea;
    color: #fff;
    border-radius: 8px;
    font-size: 0.95em;
    resize: none;
    font-family: inherit;
}

#commentInput:focus {
    outline: none;
    border-color: #764ba2;
}

.btn-comment {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: transform 0.2s;
}

.btn-comment:hover {
    transform: scale(1.02);
}

.login-prompt {
    background: #0a0e27;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.login-prompt a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.login-prompt a:hover {
    color: #764ba2;
}

/* Admin Panel */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
}

.admin-form {
    background: #1a1f3a;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
}

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

.admin-form input[type="text"] {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    background: #0a0e27;
    border: 2px solid #667eea;
    color: #fff;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.admin-form input[type="date"],
.admin-form input[type="time"] {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    background: #0a0e27;
    border: 2px solid #667eea;
    color: #fff;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
    color-scheme: dark;
}

.admin-form input[type="text"]:focus,
.admin-form input[type="date"]:focus,
.admin-form input[type="time"]:focus {
    outline: none;
    border-color: #764ba2;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    font-size: 1.1em;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 14px 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.btn-secondary {
    background: #555;
    color: #fff;
    padding: 14px 35px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    margin-left: 10px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #777;
}

.form-actions {
    margin-top: 20px;
}

.success {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    color: #000;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,255,136,0.3);
}

.search-box {
    margin-bottom: 20px;
}

#adminSearch {
    width: 100%;
    padding: 14px 20px;
    background: #1a1f3a;
    border: 2px solid #667eea;
    color: #fff;
    border-radius: 10px;
    font-size: 1em;
}

#adminSearch:focus {
    outline: none;
    border-color: #764ba2;
}

.table-container {
    background: #1a1f3a;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

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

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

th {
    padding: 18px 15px;
    text-align: left;
    font-weight: bold;
    font-size: 1em;
}

td {
    padding: 15px;
    border-bottom: 1px solid #0a0e27;
}

tbody tr:hover {
    background: #0a0e27;
}

.status-live {
    background: #ff0000;
    color: #fff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
}

.status-ended {
    background: #555;
    color: #fff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-view, .btn-edit, .btn-delete {
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1.2em;
    transition: transform 0.2s;
}

.btn-view {
    background: #4CAF50;
}

.btn-edit {
    background: #2196F3;
}

.btn-delete {
    background: #f44336;
}

.btn-view:hover, .btn-edit:hover, .btn-delete:hover {
    transform: scale(1.1);
}

footer {
    background: #1a1f3a;
    text-align: center;
    padding: 25px;
    margin-top: 60px;
    border-top: 2px solid #667eea;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 40px 20px;
}

.auth-box {
    background: #1a1f3a;
    padding: 40px;
    border-radius: 15px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.auth-box input[type="text"],
.auth-box input[type="email"],
.auth-box input[type="password"] {
    width: 100%;
    padding: 14px;
    margin: 12px 0;
    background: #0a0e27;
    border: 2px solid #667eea;
    color: #fff;
    border-radius: 8px;
    font-size: 1em;
}

.auth-box input:focus {
    outline: none;
    border-color: #764ba2;
}

.auth-box .btn-primary {
    width: 100%;
    margin-top: 20px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #a0a0a0;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.auth-link a:hover {
    color: #764ba2;
}

.error-msg {
    background: #ff4444;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.success-msg {
    background: #00ff88;
    color: #000;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

@media (max-width: 768px) {
    .video-player {
        height: 56vw;
    }

    .below-layout {
        grid-template-columns: 1fr;
    }

    .comments-section {
        max-height: 400px;
    }
    
    .vote-buttons {
        grid-template-columns: 1fr;
    }
    
    .team-btn {
        font-size: 0.85em;
        padding: 8px 12px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .nav-menu a {
        font-size: 0.9em;
        padding: 6px 10px;
    }
    
    .logo {
        font-size: 1.4em;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .matches-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.85em;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}
