/* Color principal: Ladrillo/Terracota (cancha de tenis) */
:root {
    --brick-primary: #C64537;
    --brick-dark: #A83628;
    --brick-light: #D97560;
    --brick-soft: #E09182;
    --brick-soft-dark: #CA6A57;
    --brick-bg-light: #f7eeec;
}

/* General */
* {
    transition: all 0.3s ease;
}

body {
    background: linear-gradient(135deg, var(--brick-bg-light) 0%, #f2e4e1 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.app-shell {
    padding-left: 8px;
    padding-right: 8px;
}

.app-main-col {
    padding-left: 0;
    padding-right: 0;
}

/* Cartas */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card:hover {
    box-shadow: 0 6px 28px rgba(198, 69, 55, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--brick-primary) 0%, var(--brick-dark) 100%) !important;
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 3px solid var(--brick-dark);
}

.card-header h5 {
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Botones principales */
.btn-brick {
    background: linear-gradient(135deg, var(--brick-primary) 0%, var(--brick-dark) 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
}

.btn-brick:hover {
    background: linear-gradient(135deg, var(--brick-dark) 0%, #8a2f1f 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 69, 55, 0.3);
}

.btn-brick:active {
    transform: translateY(0);
}

/* Variante clara para destacar el CTA principal sin igualar al header */
.btn-brick-soft {
    background: #ffffff;
    border: 1px solid #111111;
    color: #111111;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    letter-spacing: 0.2px;
}

.btn-brick-soft:hover {
    background: #111111;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-brick-soft:active {
    transform: translateY(0);
}

/* Botones secundarios */
.btn-secondary {
    background: #6c757d;
    border: none;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Botones de acción en tabla */
.action-btn {
    background: #ffffff;
    border: 1px solid #111111;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111111;
    transition: all 0.3s ease;
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.action-btn:hover {
    background: #111111;
    color: #ffffff;
    transform: translateY(-1px);
}

.action-btn:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.action-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 576px) {
    .action-buttons {
        flex-direction: row;
        gap: 6px;
    }

    .action-btn {
        width: 34px;
        height: 34px;
    }
}

/* Tabla */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.reservation-row {
    border-bottom: 1px solid #e9ecef;
}

.reservation-row:hover {
    background-color: rgba(198, 69, 55, 0.05);
}

.table-hover tbody tr:last-child {
    border-bottom: none;
}

.table th {
    background: linear-gradient(135deg, rgba(198, 69, 55, 0.1) 0%, rgba(198, 69, 55, 0.05) 100%);
    color: var(--brick-dark);
    font-weight: 700;
    border: none;
    padding: 12px;
}

.table td {
    padding: 12px;
    vertical-align: middle;
}

.day-cell {
    cursor: help;
    position: relative;
}

.hour-cell {
    font-weight: 500;
    color: #495057;
}

/* Modales */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, var(--brick-primary) 0%, var(--brick-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 20px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    font-weight: 700;
    font-size: 18px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 16px;
}

.modal-footer .btn {
    padding: 8px 20px;
    border-radius: 6px;
}

/* Formularios */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brick-primary);
    box-shadow: 0 0 0 0.2rem rgba(198, 69, 55, 0.25);
}

.form-label {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Header info */
.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.user-badge {
    background: linear-gradient(135deg, var(--brick-primary) 0%, var(--brick-dark) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(198, 69, 55, 0.2);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--brick-primary);
    border: 1px solid var(--brick-primary);
    font-weight: 600;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    line-height: 1.1;
    min-height: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    white-space: nowrap;
}

.logout-btn:hover {
    background: var(--brick-primary);
    color: white;
    transform: translateY(-2px);
}

/* Tooltips */
.tooltip-inner {
    background-color: var(--brick-primary);
    font-weight: 500;
    border-radius: 6px;
    padding: 8px 12px;
}

/* Alert */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
    padding: 16px;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #1e5631;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #842029;
}

.alert-info {
    background-color: rgba(17, 103, 177, 0.1);
    border-left-color: #0c63e4;
    color: #05405c;
}

/* Spinner */
.spinner-border-sm {
    color: var(--brick-primary);
}

/* Responsivo */
@media (max-width: 768px) {
    .card-header {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .card-header > h5 {
        flex: 1 1 100%;
    }

    .card-body {
        padding: 20px;
    }

    .table {
        font-size: 13px;
    }

    .table td, .table th {
        padding: 10px 6px;
    }

    .action-btn {
        font-size: 20px;
        padding: 6px;
    }

    .header-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .user-badge {
        width: auto;
        text-align: center;
        white-space: nowrap;
    }

    .logout-btn {
        width: auto;
        text-align: center;
        align-self: auto;
    }

    .modal-dialog {
        margin: 10px;
    }

    .table-responsive-wide-mobile {
        margin-left: -10px;
        margin-right: -10px;
    }
}

@media (max-width: 576px) {
    .app-shell {
        padding-left: 6px;
        padding-right: 6px;
    }

    .table {
        font-size: 12px;
    }

    .btn-brick {
        padding: 8px 16px;
        font-size: 14px;
    }

    .action-btn {
        font-size: 18px;
    }

    .table-responsive-wide-mobile {
        margin-left: -12px;
        margin-right: -12px;
    }
}

@media (min-width: 992px) {
    .app-shell {
        padding-left: 24px;
        padding-right: 24px;
    }
}
