/* ========================================
   Chess Club Manager - Custom Styles
   ======================================== */

/* Root Variables */
:root {
    --primary-color: #2c5f8d;
    --primary-dark: #1e4466;
    --primary-light: #4a7ba7;
    --secondary-color: #d4af37;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* Base Styles */
html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
}

body {
    background-color: var(--light-bg);
}

main {
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-dark);
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   Authentication Pages Styling
   ======================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.chess-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.auth-header h1 {
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #6c757d;
    font-size: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Form Styles */
.form-floating > .form-control {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 0.75rem;
    transition: var(--transition);
}

.form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(44, 95, 141, 0.15);
}

.form-floating > label {
    padding: 1rem 0.75rem;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* ========================================
   Button Styles
   ======================================== */

.btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 141, 0.4);
}

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

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

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ========================================
   Navbar Styles
   ======================================== */

.navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
    box-shadow: var(--shadow);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-text {
    color: white !important;
}

/* ========================================
   Card Styles
   ======================================== */

.card {
    border: none;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-title {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 1.25rem;
}

.card-body {
    padding: 2rem;
}

/* Dashboard Cards */
.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.dashboard-card .card-title {
    color: white;
    font-size: 1.5rem;
}

/* ========================================
   Table Styles
   ======================================== */

.table-responsive {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: white;
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(44, 95, 141, 0.05);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* ========================================
   Alert Styles
   ======================================== */

.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* ========================================
   Loading Spinner
   ======================================== */

.spinner-border {
    color: var(--primary-color);
    width: 3rem;
    height: 3rem;
    margin: 2rem auto;
    display: block;
}

/* ========================================
   Container Styles
   ======================================== */

.container {
    background-color: transparent;
}

.content-wrapper {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Page Header
   ======================================== */

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

.page-header h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Remove the broken ::before pseudo-element - icons are handled in HTML with Bootstrap Icons */
/*.page-header h1::before {
    content: '?';
    font-size: 2.5rem;
    color: var(--primary-color);
}*/

/* ========================================
   Badge Styles
   ======================================== */

.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

/* ========================================
   Error UI
   ======================================== */

#blazor-error-ui {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    bottom: 0;
    box-shadow: var(--shadow-lg);
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 1.5rem;
    background: transparent;
    border: none;
    opacity: 0.8;
    transition: var(--transition);
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .chess-icon {
        font-size: 3rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.text-primary {
    color: var(--primary-color) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.shadow-sm {
    box-shadow: var(--shadow) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Focus Styles for Accessibility */
h1:focus,
button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   Modal Styles
   ======================================== */

.modal {
    z-index: 1055;
}

.modal.show {
    display: block !important;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-backdrop.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.modal-backdrop.show {
    opacity: 1;
}

.modal-dialog {
    animation: modalSlideIn 0.3s ease;
}

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

.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 1.5rem;
    border-bottom: none;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

body.modal-open {
    overflow: hidden;
    padding-right: 0 !important; /* Prevent shift when scrollbar disappears */
}

/* Modal backdrop click area styling */
.modal.d-block {
    backdrop-filter: blur(2px);
}

/* Ensure modals stack properly */
.modal + .modal-backdrop {
    z-index: 1051;
}

.modal + .modal-backdrop + .modal {
    z-index: 1056;
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1060;
    max-width: 400px;
}

.toast {
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: none;
    margin-bottom: 1rem;
    animation: toastSlideIn 0.3s ease;
}

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

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

.toast-error {
    background-color: var(--danger-color);
    color: white;
}

.toast-info {
    background-color: var(--info-color);
    color: white;
}

.toast-warning {
    background-color: var(--warning-color);
    color: #333;
}