:root {
    --primary-color: #ff6b00;
    --secondary-color: #000000;
    --accent-color: #ffd700;
    --bg-dark: #1a1a1a;
    --bg-light: #2d2d2d;
    --text-light: #ffffff;
    --text-gray: #cccccc;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--secondary-color), #222);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.main-nav a:hover, .main-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-badge {
    background-color: var(--danger-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Page Content */
.page-content {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Tournament Header */
.tournament-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-light), #3a3a3a);
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

.tournament-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.tournament-description {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-gray);
}

.tournament-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 1rem;
}

.tournament-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tournament-meta i {
    color: var(--primary-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left: 4px solid var(--info-color);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover {
    background-color: #e05a00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.4);
}

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn-success:hover {
    background-color: #218838;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

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

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Registration Section */
.registration-section {
    background: linear-gradient(135deg, var(--bg-light), #3a3a3a);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.registration-box {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
}

.registration-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 107, 0, 0.1);
    border-radius: 5px;
}

.registration-info p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Brackets Section */
.brackets-section, .schedule-section, .notifications-section {
    margin-bottom: 2rem;
}

.brackets-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.bracket-round {
    background: linear-gradient(135deg, var(--bg-light), #3a3a3a);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

.bracket-round h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-align: center;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.match-card {
    background-color: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 107, 0, 0.3);
}

.match-card.completed {
    border-color: var(--success-color);
    opacity: 0.9;
}

.match-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--primary-color);
}

.match-number, .match-time {
    font-weight: 600;
    color: var(--accent-color);
}

.match-players {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.player.bye {
    background-color: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    font-style: italic;
}

.player.winner {
    background-color: rgba(40, 167, 69, 0.2);
    border-left: 4px solid var(--success-color);
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.player-score {
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
}

.vs {
    text-align: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.match-winner {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(23, 162, 184, 0.2));
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    color: var(--success-color);
}

.match-winner i {
    margin-right: 0.5rem;
}

.match-admin-actions {
    margin-top: 1rem;
    text-align: center;
}

/* Schedule Table */
.schedule-table-wrapper {
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
}

.schedule-table th, .schedule-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--primary-color);
}

.schedule-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.schedule-table tr:hover {
    background-color: rgba(255, 107, 0, 0.1);
}

.vs-cell {
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-badge.status-pending {
    background-color: rgba(108, 117, 125, 0.3);
    color: #6c757d;
}

.status-badge.status-scheduled {
    background-color: rgba(23, 162, 184, 0.3);
    color: var(--info-color);
}

.status-badge.status-in_progress {
    background-color: rgba(255, 193, 7, 0.3);
    color: var(--warning-color);
}

.status-badge.status-completed {
    background-color: rgba(40, 167, 69, 0.3);
    color: var(--success-color);
}

.status-badge.status-cancelled {
    background-color: rgba(220, 53, 69, 0.3);
    color: var(--danger-color);
}

/* Notifications */
.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.notification-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
    background-color: rgba(255, 107, 0, 0.1);
    border-left: 4px solid var(--primary-color);
}

.notification-icon {
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.notification-content {
    flex: 1;
}

.notification-message {
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.notification-time {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Admin Panel */
.admin-container {
    max-width: 1600px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.admin-card {
    background: linear-gradient(135deg, var(--bg-light), #3a3a3a);
    padding: 2rem;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

.admin-card.full-width {
    grid-column: 1 / -1;
}

.admin-card h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-align: center;
}

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

.info-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-table td {
    padding: 0.8rem 1rem;
}

.info-table td:first-child {
    font-weight: 600;
    color: var(--text-gray);
    width: 40%;
}

.info-table td:last-child {
    color: var(--text-light);
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-admin {
    background: linear-gradient(135deg, var(--primary-color), #e05a00);
    padding: 1rem;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.btn-admin:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.4);
}

.btn-admin i {
    margin-right: 1rem;
    font-size: 1.2rem;
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-gray);
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
    margin-bottom: 10px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, var(--secondary-color), #222);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: var(--text-gray);
}

.footer-container p {
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tournament-meta {
        flex-direction: column;
        align-items: center;
    }
    
    .matches-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* Tournament Details Section */
.tournament-details-section {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--bg-light), #3a3a3a);
    padding: 2rem;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

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

.detail-card {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.detail-card h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-card ul {
    list-style: none;
    padding: 0;
}

.detail-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-card li:last-child {
    border-bottom: none;
}

.detail-card strong {
    color: var(--accent-color);
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.admin-header h1 {
    color: var(--accent-color);
}

/* Participants Controls */
.participants-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 107, 0, 0.1);
    border-radius: 8px;
}

.participants-controls .stats {
    display: flex;
    gap: 2rem;
}

.participants-controls .stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tables */
.participants-table-wrapper, .matches-table-wrapper {
    overflow-x: auto;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1rem;
}

.participants-table, .matches-table {
    width: 100%;
    border-collapse: collapse;
}

.participants-table th, .participants-table td,
.matches-table th, .matches-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--primary-color);
}

.participants-table th, .matches-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.participants-table tr:hover, .matches-table tr:hover {
    background-color: rgba(255, 107, 0, 0.1);
}

.participants-table tr.disqualified {
    opacity: 0.5;
    background-color: rgba(220, 53, 69, 0.1) !important;
}

/* Prize Distribution */
.prize-distribution-table table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
}

.prize-distribution-table th, .prize-distribution-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--primary-color);
}

.prize-distribution-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Schedule Info */
.schedule-info {
    background-color: rgba(255, 107, 0, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.schedule-info p {
    margin: 0.5rem 0;
}

/* Match Date in Schedule Table */
.match-date {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

.match-time {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Match Date-Time in Brackets */
.match-date-time {
    text-align: right;
    margin-top: 0.5rem;
}

.match-date-time .match-date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 0.2rem;
}

.match-date-time .match-time {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .match-date-time {
        text-align: left;
        margin-top: 0.8rem;
    }
}