/**
 * Admin Pages Styles - Modern Dark Theme
 * Mobile-first
 */

/* Admin Page Header */
.admin-header {
    background: var(--gradient-header);
    padding: 1rem 0.75rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.admin-header h1 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.admin-header p {
    color: var(--text-secondary);
    margin: 0;
}

/* Admin Page Header (Pattern C for Forms) */
.admin-page-header {
    margin-bottom: 2rem;
}

.admin-page-header .page-header-main {
    padding: 2rem 1rem;
}

.admin-page-header h1 {
    margin: 0 0 0.5rem 0;
}

.admin-page-header .page-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* When only admin badge is present (no back button) */
.header-top-row:has(.admin-badge:only-child) {
    justify-content: flex-end;
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(*)) {
    .header-top-row > .admin-badge:first-child:last-child {
        margin-left: auto;
    }
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-purple);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-badge i {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .admin-page-header {
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .admin-page-header .page-header-main {
        padding: 1.5rem 0.75rem;
    }

    .admin-page-header h1 {
        font-size: 1.5rem;
    }

    .admin-page-header .page-subtitle {
        font-size: 0.875rem;
    }

    .header-top-row {
        margin-bottom: 0.625rem;
    }

    .admin-badge {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .admin-badge i {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .admin-page-header {
        margin-bottom: 1rem;
        padding: 0 0.75rem;
    }

    .admin-page-header .page-header-main {
        padding: 1.25rem 0.5rem;
    }

    .admin-page-header h1 {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .admin-page-header .page-subtitle {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .header-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .admin-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.625rem;
    }
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 1rem 0.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Form Card */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem 0.75rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.form-header h2 {
    color: var(--text-primary);
    margin: 0;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

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

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

/* Dashboard */
.dashboard-header {
    background: var(--gradient-header);
    padding: 1rem 0.75rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 0.75rem;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-gold);
}

.dashboard-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.dashboard-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.dashboard-card p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem 0.75rem;
    border: 1px solid var(--border-light);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Error Messages */
.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-top: 0.5rem;
    color: #fca5a5;
    font-size: 0.85rem;
}

.error-message {
    color: #fca5a5;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Success Messages */
.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #6ee7b7;
}

/* Warning Box */
.warning-box {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 1rem 0;
    color: #fcd34d;
    font-size: 0.9rem;
}

/* Delete Confirmation */
.delete-confirmation {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.delete-confirmation h3 {
    color: #fca5a5;
    margin-bottom: 1rem;
}

.delete-confirmation p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.delete-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-group:hover {
    background: var(--bg-hover);
}

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

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

/* Help Text */
.help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Required Field Indicator */
.required {
    color: var(--accent-red);
    margin-left: 0.25rem;
}

/* Form Navigation */
.form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.form-nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive */
@media (min-width: 640px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 0.75rem 0.5rem;
    }

    .dashboard-header {
        padding: 0.75rem 0.5rem;
    }

    .login-card {
        padding: 0.75rem 0.5rem;
    }

    .form-card {
        padding: 0.75rem 0.5rem;
    }

    .dashboard-card {
        padding: 0.75rem 0.5rem;
    }

    .stat-card {
        padding: 0.75rem 0.5rem;
    }

    .form-error,
    .success-message,
    .warning-box {
        padding: 0.75rem 0.5rem;
    }

    .delete-confirmation {
        padding: 1rem 0.5rem;
    }

    .checkbox-group {
        padding: 0.75rem 0.5rem;
    }

    .form-nav {
        padding: 1rem 0.5rem;
    }

    .scoring-tile {
        padding: 1.25rem 0.75rem;
    }
}

@media (min-width: 768px) {
    .login-card {
        padding: 3rem;
    }

    .form-card {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* Penalty Management */
.penalty-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.penalty-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-gold);
}

.penalty-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: end;
}

.penalty-actions {
    display: flex;
    align-items: flex-end;
}

.penalty-actions button {
    width: 100%;
}

#penalties-container:empty::after {
    content: "No penalties added yet. Click 'Add Penalty' to define penalties for this game.";
    display: block;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(15, 23, 42, 0.3);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-light);
}

@media (min-width: 640px) {
    .penalty-row {
        grid-template-columns: 2fr 1fr 1fr auto;
    }
}

@media (min-width: 768px) {
    .penalty-item {
        padding: 1.5rem;
    }
}

/* Scoring Direction Toggle Tiles */
.scoring-direction-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.scoring-tile {
    position: relative;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.scoring-tile:hover {
    background: var(--bg-hover);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.scoring-tile.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05));
    border-color: var(--accent-gold);
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2),
                0 8px 24px rgba(251, 191, 36, 0.3);
}

.tile-icon {
    font-size: 3rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.scoring-tile:hover .tile-icon {
    transform: scale(1.1);
}

.scoring-tile.active .tile-icon {
    transform: scale(1.15);
}

.tile-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.scoring-tile.active .tile-label {
    color: var(--accent-gold);
}

.tile-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
    text-align: center;
}

@media (max-width: 640px) {
    .scoring-direction-tiles {
        grid-template-columns: 1fr;
    }

    .scoring-tile {
        padding: 1.5rem 1rem;
    }

    .tile-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 0.5rem 0.35rem;
    }

    .dashboard-header {
        padding: 0.5rem 0.35rem;
    }

    .login-card {
        padding: 0.5rem 0.35rem;
    }

    .form-card {
        padding: 0.5rem 0.35rem;
    }

    .dashboard-card {
        padding: 0.5rem 0.35rem;
    }

    .stat-card {
        padding: 0.5rem 0.35rem;
    }

    .form-error,
    .success-message,
    .warning-box {
        padding: 0.5rem 0.35rem;
    }

    .delete-confirmation {
        padding: 0.75rem 0.35rem;
    }

    .checkbox-group {
        padding: 0.5rem 0.35rem;
    }

    .form-nav {
        padding: 0.75rem 0.35rem;
    }

    .scoring-tile {
        padding: 1rem 0.5rem;
    }

    .penalty-item {
        padding: 0.75rem 0.5rem;
    }
}