/* ============================================
   Club de Polo - Sistema de Visitas
   Estilos personalizados
   ============================================ */

/* Variables CSS corporativas */
:root {
    --primary-color: #007A53;
    --primary-dark: #007A53;
    --primary-light: #3A8D7A;
    --secondary-color: #00ACC1;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #F44336;
    --background-color: #F5F5F5;
    --surface-color: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --drawer-width: 260px;
}

/* Reset y base */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Roboto', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Evitar scroll en contenedor principal */
.mud-layout {
    height: 100vh !important;
    overflow: hidden !important;
}

.mud-main-content {
    height: calc(100vh - 64px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 122, 83, 0.85) 0%, rgba(58, 141, 122, 0.75) 100%);
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 30px;
    text-align: center;
}

.login-logo {
    max-width: 180px;
    max-height: 80px;
    margin-bottom: 15px;
}

.login-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
}

.login-body {
    padding: 30px;
}

.login-footer {
    padding: 20px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.powered-by img {
    max-height: 30px;
}

/* ============================================
   Main Layout
   ============================================ */
.app-bar-logo {
    max-height: 40px;
    margin-right: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: 500;
    color: white;
}

/* Drawer / Sidebar */
.drawer-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(180deg, #f5f5f5 0%, #ffffff 100%);
}

.drawer-logo {
    max-width: 150px;
    max-height: 60px;
}

.nav-menu {
    padding: 10px 0;
}

.nav-item {
    margin: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(0, 122, 83, 0.08);
}

.nav-item.active {
    background-color: rgba(0, 122, 83, 0.12);
    color: var(--primary-color);
}

.nav-item .mud-nav-link-icon {
    color: var(--primary-color);
}

/* Forzar color verde en iconos del drawer */
.mud-drawer .mud-nav-link .mud-icon-root {
    color: #007A53 !important;
}

.mud-drawer .mud-nav-link.active .mud-icon-root {
    color: #007A53 !important;
}

.mud-drawer .mud-nav-link:hover .mud-icon-root {
    color: #007A53 !important;
}

.drawer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.stat-card {
    padding: 24px;
    text-align: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Forms
   ============================================ */
.form-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* ============================================
   Data Grid
   ============================================ */
.data-grid-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-section {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.mud-table-head {
    background: linear-gradient(180deg, #f5f5f5 0%, #eeeeee 100%);
}

.mud-table-head .mud-table-cell {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* ============================================
   Help Page
   ============================================ */
.help-section {
    margin-bottom: 16px;
}

.help-section .mud-expand-panel {
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.help-section .mud-expand-panel-header {
    font-weight: 500;
}

.help-content {
    padding: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 960px) {
    .login-container {
        padding: 10px;
    }
    
    .login-header {
        padding: 20px;
    }
    
    .login-body {
        padding: 20px;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .mud-button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .stat-value {
        font-size: 2rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
    }
    
    .dashboard-card {
        margin-bottom: 12px;
    }
    
    .mud-main-content {
        padding: 12px !important;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* ============================================
   Utilities
   ============================================ */
.cursor-pointer {
    cursor: pointer;
}

.no-scroll {
    overflow: hidden !important;
}

.full-height {
    height: 100%;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   Error UI
   ============================================ */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ni42MDYgNTIuMjY1OEwyOTAuMTgxIDc1LjgzODdDMjkwLjk2MyA3Ni42MzE5IDI5MS40NDcgNzcuNzI3MSAyOTEuNDQ3IDc4LjkzODNDMjkxLjQ0NyA4MC4xNDk0IDI5MC45NjMgODEuMjQ0NiAyOTAuMTgxIDgyLjAzNzhMMjc1LjY0MyA5Ni41765markup1markup2markup3markup4markup5markup6markup7markup8markup9markup0) no-repeat 1rem/1.8rem;
    padding: 1rem 1rem 1rem 3.7rem;
}

.blazor-error-boundary::after {
    content: "Se ha producido un error.";
}
