/* SGLMan Custom Styles */

/* Layout & Container Styles */
.page-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.page-container-narrow {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.page-container-wide {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.full-width {
    width: 100%;
}

.full-width-column {
    width: 100%;
    padding: 1em;
}

/* Flex utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spacing utilities */
.mb-1 { margin-bottom: 1em; }
.ml-1 { margin-left: 1em; }

/* Header & Title Styles */
.page-title {
    font-size: 2em;
    font-weight: bold;
}

.section-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 1em;
    color: #1976d2;
}

.subsection-title {
    font-size: 1.3em;
    font-weight: bold;
}

.large-title {
    font-size: 1.8em;
    font-weight: bold;
    margin: 0 1em;
}

.header-row {
    width: 100%;
    align-items: center;
    margin-bottom: 1.5em;
}

/* Card Styles */
.card-padding {
    padding: 1.5em;
}

.card-padding-large {
    padding: 2em;
}

.card-centered {
    padding: 2em;
    text-align: center;
}

.card-full-width {
    width: 100%;
    margin-bottom: 1.5em;
    padding: 1.5em;
}

.card-list-item {
    width: 100%;
    margin-bottom: 0.5em;
}

/* Form & Input Styles */
.input-full-width {
    width: 100%;
}

.input-label {
    font-weight: 500;
    margin-bottom: 0.3em;
    color: #666;
}

.form-grid {
    width: 100%;
    gap: 1em;
}

/* Dialog Styles */
.dialog-card {
    min-width: 700px;
    max-width: 90vw;
}

@media (max-width: 768px) {
    .dialog-card {
        min-width: unset;
        width: 90vw;
    }
}

.dialog-card-small {
    min-width: 350px;
}

@media (max-width: 768px) {
    .dialog-card-small {
        min-width: unset;
        width: 90vw;
    }
}

/* Button & Action Styles */
.button-row {
    width: 100%;
    justify-content: flex-end;
    margin-top: 1em;
}

.button-row-centered {
    width: 100%;
    justify-content: center;
    margin-top: 1em;
}

.action-row {
    margin-top: 1em;
}

/* Separator Styles */
.separator-spacing {
    margin-bottom: 1.5em;
}

/* Icon Styles */
.icon-large {
    color: #FF9800;
    margin-bottom: 0.5em;
}

.icon-error {
    color: #f44336;
    margin-bottom: 0.5em;
}

.icon-primary {
    color: #1976d2;
    margin-right: 0.5em;
}

.icon-spacing {
    margin-right: 0.5em;
}

/* Text & Label Styles */
.text-muted {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 1em;
}

.text-italic {
    color: #666;
    font-size: 1.2em;
}

.text-gray {
    color: gray;
}

.text-success {
    color: #4CAF50;
}

.text-warning {
    color: #FF9800;
    font-style: italic;
}

.text-error {
    color: red;
    font-weight: bold;
}

.text-link {
    color: #1976d2;
    text-decoration: underline;
}

.table-link {
    color: #1976d2;
    text-decoration: underline;
    cursor: pointer;
}

.italic-note {
    font-style: italic;
}

/* Timeline/Schedule Specific Styles */
.timeline-container {
    width: 100%;
}

.timeline-header {
    width: 100%;
    align-items: center;
    margin-bottom: 1em;
}

.room-header {
    width: 100%;
    align-items: center;
    background-color: #1976d2;
    color: white;
    padding: 0.5em;
    border-radius: 4px;
}

.room-name {
    font-size: 1.3em;
    font-weight: bold;
}

.room-link {
    margin-left: auto;
    color: white;
    text-decoration: underline;
}

.room-match-count {
    font-size: 0.9em;
    opacity: 0.9;
}

.match-card {
    width: 100%;
    margin-bottom: 0.5em;
}

.match-time {
    font-size: 1.2em;
    font-weight: bold;
    min-width: 60px;
}

.match-badge {
    margin-left: 0.5em;
}

.match-tournament {
    margin-left: 1em;
    font-weight: 500;
}

.match-details {
    width: 100%;
    margin-top: 0.5em;
}

.match-details-nested {
    width: 100%;
    margin-top: 0.3em;
}

.match-players {
    font-size: 1.1em;
}

.empty-state {
    color: gray;
    font-style: italic;
    text-align: center;
    padding: 2em;
}

/* User/Avatar Styles */
.user-name {
    margin-left: auto;
}

.user-avatar {
    margin-left: 8px;
    margin-right: 8px;
    max-width: 32px;
    max-height: 32px;
}

.login-button {
    margin-left: auto;
}

/* Flex & Layout Utilities */
.flex-1 {
    flex: 1;
    min-width: 0;
}

.row-spacing {
    width: 100%;
    gap: 1em;
    margin-bottom: 0.5em;
}

.row-centered {
    align-items: center;
    margin-bottom: 1em;
}

.column-spacing {
    width: 100%;
    padding: 0.5em;
}

/* Chart & Report Styles */
.chart-container {
    width: 100%;
    min-height: 500px;
}

.chart-height {
    width: 100%;
    height: 400px;
}

.control-width {
    width: 400px;
}

/* Border Utilities */
.border-left-green {
    border-left: 4px solid #4CAF50;
}

.border-left-orange {
    border-left: 4px solid #FF9800;
}

.border-left-gray {
    border-left: 4px solid #9E9E9E;
}

.border-left-blue {
    border-left: 4px solid #2196F3;
}

/* Visibility Utilities */
.hidden {
    display: none;
}

/* Refresh Button */
.refresh-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

/* User Table Styles */
.user-table th,
.user-table td {
    border-right: 1px solid #ccc;
}

.user-table td {
    text-align: left;
}

/* Allow wrapping for long strings */
.user-table td .wrap {
    display: block;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: 320px;
}

.user-table th {
    text-align: center;
}

.user-table th:last-child,
.user-table td:last-child {
    border-right: none;
}

.user-table {
    border-collapse: collapse;
}

.user-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.user-table tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Dark mode overrides for user table */
.body--dark .user-table th,
.body--dark .user-table td {
    border-right: 1px solid #444;
}

.body--dark .user-table tr:nth-child(even) {
    background-color: #2b2b2b;
}

.body--dark .user-table tr:nth-child(odd) {
    background-color: #1f1f1f;
}

.q-dark .user-table th,
.q-dark .user-table td {
    border-right: 1px solid #444;
}

.q-dark .user-table tr:nth-child(even) {
    background-color: #2b2b2b;
}

.q-dark .user-table tr:nth-child(odd) {
    background-color: #1f1f1f;
}

/* Mobile grid card dark styling */
.body--dark .user-grid-card {
    background: #1e1e1e !important;
    border-color: #444 !important;
}

.q-dark .user-grid-card {
    background: #1e1e1e !important;
    border-color: #444 !important;
}

/* Tournament Table Styles */
.tournament-table th,
.tournament-table td {
    border-right: 1px solid #ccc;
}

.tournament-table td {
    text-align: left;
}

/* Allow wrapping and truncation for long fields */
.tournament-table td .wrap {
    display: block;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: 320px;
}

.tournament-table th {
    text-align: center;
}

.tournament-table th:last-child,
.tournament-table td:last-child {
    border-right: none;
}

.tournament-table {
    border-collapse: collapse;
}

.tournament-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.tournament-table tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Dark mode overrides for tournament table */
.body--dark .tournament-table th,
.body--dark .tournament-table td {
    border-right: 1px solid #444;
}

.body--dark .tournament-table tr:nth-child(even) {
    background-color: #2b2b2b;
}

.body--dark .tournament-table tr:nth-child(odd) {
    background-color: #1f1f1f;
}

.q-dark .tournament-table th,
.q-dark .tournament-table td {
    border-right: 1px solid #444;
}

.q-dark .tournament-table tr:nth-child(even) {
    background-color: #2b2b2b;
}

.q-dark .tournament-table tr:nth-child(odd) {
    background-color: #1f1f1f;
}

/* Mobile grid card dark styling for tournament */
.body--dark .tournament-grid-card {
    background: #1e1e1e !important;
    border-color: #444 !important;
}

.q-dark .tournament-grid-card {
    background: #1e1e1e !important;
    border-color: #444 !important;
}

/* Match Table Styles */
.match-table th,
.match-table td {
    border-right: 1px solid #ccc;
}

.match-table td {
    text-align: left;
}

/* Allow wrapping for long lists of names in table view for specific columns */
/* Target the inner wrapper element placed inside the q-td, not the td itself */
.match-table td .wrap {
    display: block;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: 120px; /* reasonable default, table can expand as needed */
}

/* Ensure links inside the wrapper also wrap */
.match-table td .wrap a {
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: break-word;
}

.match-table th {
    text-align: center;
}

.match-table th:last-child,
.match-table td:last-child {
    border-right: none;
}

.match-table {
    border-collapse: collapse;
}

.match-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.match-table tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Dark mode overrides for match table */
.body--dark .match-table th,
.body--dark .match-table td {
    border-right: 1px solid #444;
}

.body--dark .match-table tr:nth-child(even) {
    background-color: #2b2b2b;
}

.body--dark .match-table tr:nth-child(odd) {
    background-color: #1f1f1f;
}

.q-dark .match-table th,
.q-dark .match-table td {
    border-right: 1px solid #444;
}

.q-dark .match-table tr:nth-child(even) {
    background-color: #2b2b2b;
}

.q-dark .match-table tr:nth-child(odd) {
    background-color: #1f1f1f;
}

/* Match filters card styling */
.match-filters-card {
    width: 100%;
    padding: 1em;
    margin-bottom: 1em;
    background-color: #f5f5f5;
}

.body--dark .match-filters-card {
    background-color: #1f1f1f !important;
}

.q-dark .match-filters-card {
    background-color: #1f1f1f !important;
}

/* Match grid card dark styling */
.body--dark .match-grid-card {
    background: #1e1e1e !important;
    border-color: #444 !important;
}

.q-dark .match-grid-card {
    background: #1e1e1e !important;
    border-color: #444 !important;
}

/* Match filter layout */
.match-filter-row {
    width: 100%;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}

.match-filter-column {
    min-width: 180px;
}

.match-filter-label {
    font-size: 0.85em;
    font-weight: 500;
    color: #666;
    margin-bottom: 0.3em;
}

.match-table-container {
    margin-top: 1em;
    width: 100%;
}

.user-table-container {
    margin-top: 1em;
    width: 100%;
}

.tournament-table-container {
    margin-top: 1em;
    width: 100%;
}

/* Footer Styles */
.footer-dark-override {
    background-color: #f5f5f5;
    color: #666;
}

.body--dark .footer-dark-override {
    background-color: #1e1e1e !important;
    color: #aaa !important;
}

.q-dark .footer-dark-override {
    background-color: #1e1e1e !important;
    color: #aaa !important;
}
