/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

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

.btn-success {
    background: #28a745;
    color: white;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    text-align: center;
}

/* Admin Header */
.admin-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
}

.goal-icon {
    font-size: 32px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-actions span {
    color: #666;
}

/* User Display */
.user-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-weight: 500;
}

.user-icon {
    font-size: 18px;
}

/* Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0;
    line-height: 1;
}

.btn-icon:hover {
    background: #5a6268;
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* Admin Main */
.admin-main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.dashboard-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 28px;
    color: #333;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Matches List */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-header {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.date-matches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.match-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
}

.match-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.match-card.active {
    border-color: #28a745;
    background: #f0fff4;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.match-location {
    font-weight: 600;
    color: #555;
}

.active-badge {
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 10px;
}

.team {
    flex: 1;
    text-align: center;
}

.team-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.team-name {
    display: block;
    font-weight: 600;
    color: #333;
}

.vs {
    font-weight: 600;
    color: #999;
    font-size: 14px;
}

.match-score {
    text-align: center;
    margin-bottom: 8px;
    font-size: 40px;
    font-weight: 700;
    color: #333;
    margin-top: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.match-score .score {
    line-height: 1;
    display: inline-block;
}

.match-datetime {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.score-separator {
    margin: 0;
    line-height: 1;
    font-size: 32px;
    font-weight: 700;
    color: #333 !important;
    display: inline-flex;
    align-items: center;
    opacity: 1;
    vertical-align: middle;
}

.match-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content-large {
    max-width: 1200px;
    width: 95%;
}

.modal-header {
    padding: 20px;
    padding-left: 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal form {
    padding: 20px;
    padding-left: 30px;
    padding-right: 30px;
}

.modal-actions {
    padding: 20px;
    padding-left: 30px;
    padding-right: 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Match Detail Page */
.match-detail-container {
    max-width: 900px;
    margin: 0 auto;
}

.match-detail-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.match-info {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.match-info h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #333;
}

.match-datetime-display {
    font-size: 16px;
    color: #666;
    margin-top: 10px;
    margin-bottom: 10px;
}

.match-status {
    margin-top: 15px;
}

/* Score Controls */
.score-controls {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 40px 0;
    gap: 20px;
    flex-wrap: nowrap; /* Keep teams on same row on mobile */
}

.team-score-panel {
    flex: 1;
    text-align: center;
    padding: 15px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    min-width: 0; /* Allow flex shrinking */
}

.team-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-name-large {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    word-wrap: break-word;
}

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

.score-display {
    font-size: 56px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
    margin: 0;
}

.btn-score {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.btn-score-up {
    background: #28a745;
    color: white;
}

.btn-score-up:hover {
    background: #218838;
    transform: scale(1.1);
}

.btn-score-up:active {
    transform: scale(0.95);
}

.btn-score-down {
    background: #dc3545;
    color: white;
}

.btn-score-down:hover {
    background: #c82333;
    transform: scale(1.1);
}

.btn-score-down:active {
    transform: scale(0.95);
}

.score-separator-large {
    font-size: 48px;
    font-weight: 700;
    color: #999;
}

.match-edit-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.match-edit-section h3 {
    margin-bottom: 20px;
    color: #333;
}

/* Collapsible Section */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    margin: -10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.collapsible-header:hover {
    background-color: #f8f9fa;
}

.collapsible-header h3 {
    margin: 0;
    margin-bottom: 0;
}

.collapsible-icon {
    font-size: 18px;
    color: #666;
    transition: transform 0.2s;
}

.collapsible-content {
    margin-top: 20px;
    animation: slideDown 0.3s ease-out;
}

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

/* Scoreboard Display/Score (OBS) */
.scoreboard-display {
    background: transparent;
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    font-family: 'Arial Black', Arial, sans-serif;
}

/* Centered layout for 720p scoreboard */
body.resolution-720p.scoreboard-display {
    width: 1280px;
    height: 720px;
}

body.resolution-720p.scoreboard-display .scoreboard {
    width: 100%;
    display: flex;
    justify-content: center;
}

body.resolution-720p.scoreboard-display .scoreboard-teams {
    justify-content: center;
}

/* Centered layout for 1080p scoreboard */
body.resolution-1080p.scoreboard-display {
    width: 1920px;
    height: 1080px;
}

body.resolution-1080p.scoreboard-display .scoreboard {
    width: 100%;
    display: flex;
    justify-content: center;
}

body.resolution-1080p.scoreboard-display .scoreboard-teams {
    justify-content: center;
}

.scoreboard-container {
    width: 100%;
    max-width: 1400px;
    padding: 10px;
}

body.scoreboard-display .scoreboard-container {
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}

body.scoreboard-display {
    overflow: hidden;
}

.scoreboard {
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px 40px;
    border-radius: 10px;
    display: inline-block;
}

.scoreboard-location {
    font-size: 48px;
    color: #fff;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.scoreboard-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.scoreboard-team {
    flex: 0 0 auto;
    min-width: 120px;
}

.scoreboard-team:first-child {
    text-align: right;
    margin-right: 20px;
}

.scoreboard-team:last-child {
    text-align: left;
    margin-left: 20px;
}

.scoreboard-team-name {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.scoreboard-team-label {
    font-size: 24px;
    color: #aaa;
    letter-spacing: 2px;
}

.scoreboard-score {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.score-number {
    font-size: 56px;
    font-weight: 700;
    color: #fff;
    min-width: 80px;
}

.score-separator {
    font-size: 48px;
    color: #fff !important;
    font-weight: 300;
}

.scoreboard-empty {
    text-align: center;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.scoreboard-empty-message {
    font-size: 32px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    padding: 0;
}

.scoreboard-error {
    font-size: 14px;
    color: #dc3545;
    text-align: center;
}

/* Scoreboard Starting/Info (OBS) */
.scoreboard-starting {
    background: transparent;
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    font-family: Arial, sans-serif;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
    line-height: 1;
}

/* Centered layout for 720p */
body.resolution-720p .scoreboard-starting {
    align-items: flex-start;
    justify-content: center;
    width: 1280px;
    height: 720px;
}

/* Centered layout for 1080p */
body.resolution-1080p .scoreboard-starting {
    align-items: flex-start;
    justify-content: center;
    width: 1920px;
    height: 1080px;
}

.scoreboard-starting .starting-item {
    font-size: 32px !important;
    font-weight: normal;
    color: #fff;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    display: inline-block;
    line-height: 1;
}

body.scoreboard-starting {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.scoreboard-starting .scoreboard-container {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

/* Resolution-specific body sizing */
body.resolution-720p {
    width: 1280px;
    height: 720px;
}

body.resolution-1080p {
    width: 1920px;
    height: 1080px;
}

.scoreboard-starting .starting-item {
    font-size: 18px;
    font-weight: normal;
    color: #fff;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    display: inline-block;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

/* Footer */
.admin-footer {
    background: white;
    padding: 20px 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.admin-footer p {
    margin: 0;
}

.admin-footer a {
    color: #667eea;
    text-decoration: none;
}

.admin-footer a:hover {
    text-decoration: underline;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-main {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .scoreboard-teams {
        flex-direction: column;
        gap: 30px;
    }

    .scoreboard-score {
        flex-direction: row;
        justify-content: center;
    }

    .score-number {
        font-size: 96px;
        min-width: 120px;
    }

    .scoreboard-team-name {
        font-size: 48px;
    }

    .scoreboard-location {
        font-size: 32px;
    }

    /* Keep score controls on same row on mobile */
    .score-controls {
        gap: 10px;
        margin: 30px 0;
    }

    .team-score-panel {
        padding: 15px 10px;
    }

    .team-name-large {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .score-display {
        font-size: 48px;
    }

    .btn-score {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .score-separator-large {
        font-size: 24px;
        padding: 0 5px;
    }
}

