/* Base Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */


.animated-title {
    animation: fadeInDown 0.8s ease-out;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-add {
    background-color: var(--secondary-color);
    color: white;
}

.btn-add:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}

.btn-report {
    background-color: var(--primary-color);
    color: white;
}

.btn-report:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-edit {
    background-color: var(--primary-color);
    color: white;
}

.btn-edit:hover {
    background-color: #2980b9;
}

.btn-delete {
    background-color: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.btn-submit {
    background-color: var(--secondary-color);
    color: white;
}

.btn-submit:hover {
    background-color: #27ae60;
}

.btn-cancel {
    background-color: var(--gray-color);
    color: white;
}

.btn-cancel:hover {
    background-color: #7f8c8d;
}

.btn-print {
    background-color: var(--dark-color);
    color: white;
}

.btn-print:hover {
    background-color: #1a252f;
}

.btn-back {
    background-color: var(--gray-color);
    color: white;
}

.btn-back:hover {
    background-color: #7f8c8d;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Tournament Cards */
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tournament-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tournament-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    color: white;
}

.card-body {
    padding: 15px;
}

.card-body p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Level Badges */
.level-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.level-school {
    background-color: #2ecc71;
}

.level-district {
    background-color: #3498db;
}

.level-state {
    background-color: #9b59b6;
}

.level-national {
    background-color: #f39c12;
}

.level-international {
    background-color: #e74c3c;
}

/* Forms */
.tournament-form {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.file-info {
    margin-top: 8px;
    font-size: 14px;
}

.file-info a {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-info a:hover {
    text-decoration: underline;
}

/* No Records */
.no-records {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: var(--gray-color);
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.no-records i {
    font-size: 50px;
    color: var(--gray-color);
}

/* Report Styles */
.report-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.summary-content h3 {
    margin: 0;
    font-size: 28px;
    color: var(--dark-color);
}

.summary-content p {
    margin: 5px 0 0;
    color: var(--gray-color);
}

.report-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.report-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.chart-container {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

.recent-tournaments {
    margin-top: 20px;
}

.recent-tournaments table {
    width: 100%;
    border-collapse: collapse;
}

.recent-tournaments th,
.recent-tournaments td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.recent-tournaments th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
}

.recent-tournaments tr:hover {
    background-color: #f8f9fa;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .tournaments-grid {
        grid-template-columns: 1fr;
    }

    .report-summary {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}
/* PDF Links Styles */
.pdf-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    color: #e74c3c;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pdf-link:hover {
    background-color: #e74c3c;
    color: white;
    transform: translateY(-2px);
}

.pdf-link i {
    font-size: 16px;
}

/* Table PDF Links */
.pdf-links-cell {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pdf-links-cell .pdf-link {
    padding: 3px 8px;
}

.no-pdf {
    color: #95a5a6;
    font-style: italic;
    font-size: 14px;
}
/* Charts Row Styles */
.charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.charts-row .chart-container {
    flex: 1;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: 400px;
}

.charts-row .chart-container h2 {
    margin-bottom: 15px;
    font-size: 18px;
}

/* Adjust chart canvas */
.charts-row .chart-container canvas {
    width: 100% !important;
    height: calc(100% - 40px) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .charts-row {
        flex-direction: column;
    }

    .charts-row .chart-container {
        height: 300px;
    }
}/* Search Box Styles */
.search-container {
    margin-bottom: 25px;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.search-box .clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    cursor: pointer;
    display: none;
}

.search-box .clear-search:hover {
    color: #e74c3c;
}

.search-box input {
    width: 100%;
    padding: 12px 40px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-box {
        max-width: 100%;
    }
}
/* Scrollable Table Styles */
.table-container {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
}

.table-container thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Make sure the table header has the same styling as before */
.table-container thead th {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    color: var(--dark-color);
}

/* Add a subtle shadow when scrolling to indicate more content */
.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 8px 8px 0;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
/* Game Name Tooltip Styles */
/* Table Container Styles */
.table-container {
    max-height: 500px;
    overflow-y: auto;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

/* Table Header Fix */
.table-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-container thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 100;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Tooltip Container */
.game-name-tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-bottom: 1px dotted #666;
}

/* Tooltip Content */
.game-name-tooltip .tooltip-text {
    visibility: hidden;
    width: 400px;
    max-width: calc(100vw - 40px);
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    position: fixed; /* Changed from absolute to fixed */
    z-index: 999999;
    bottom: auto;
    top: 0;
    left: 0;
    transform: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    pointer-events: none;
}

/* Tooltip Positioning with JavaScript */
.game-name-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Tooltip Arrow */
.game-name-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 20px;
    border-width: 8px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}


/* Add this to your existing CSS */
@media (max-width: 768px) {
    .charts-row {
        display: none;
    }

    /* Optional: Show a message when charts are hidden */
    .container::after {
        content: "Charts are available on larger screens";
        display: block;
        text-align: center;
        color: #666;
        font-style: italic;
        margin: 20px 0;
    }
}