/* Garage Manager - Frontend Styles */

.garage-manager-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Tabs */
.garage-manager-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.garage-tab-button {
    padding: 12px 24px;
    background: #fff;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 3px 3px 0 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.garage-tab-button:hover {
    color: #333;
    background: #f5f5f5;
}

@media (max-width: 768px) {
    .garage-tab-button .tab-text {
        display: none;
    }

    .garage-tab-button {
        padding: 12px 15px;
    }
}

.garage-tab-button.active {
    color: black;
    border-bottom-color: greenyellow;
    background-color: #fff;
    font-weight: bold;
}

/* Tab Content */
.garage-tab-content {
    display: none;
}

.garage-tab-content.active {
    display: block;
}

.garage-tab-content h2 {
    display: none;
}

/* Notice */
.garage-notice {
    padding: 15px 20px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin: 20px 0;
    border-radius: 4px;
}

.garage-notice p {
    margin: 0;
    color: #856404;
}

/* Garage Item */
.garage-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.garage-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 24px;
}

.garage-address {
    color: #666;
    margin-bottom: 20px;
}

/* Stats */
.garage-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 6px;
}

.garage-stats span {
    padding: 8px 16px;
    background: #fff;
    border-radius: 4px;
    font-weight: 500;
}

.garage-owners-table {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid lightgray;
    min-width: 100%;
    width: auto;
}

.garage-owners-table th,
.garage-owners-table td {
    white-space: nowrap;
}

.add-owner-section {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Sections */
.garage-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    position: relative;
}

.garage-section h4 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    display: inline-block;
}

.garage-section>.garage-btn-icon {
    position: absolute;
    top: 30px;
    right: 0;
}

/* Buttons */
.garage-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.garage-btn-primary {
    background: greenyellow;
    color: black;
}

.garage-btn-primary:hover {
    background: lawngreen;
    color: black;
}

.garage-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.garage-btn-secondary:hover {
    background: #d0d0d0;
}

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

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

.garage-btn-small {
    padding: 6px 12px;
    font-size: 13px;
    margin-right: 5px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.garage-btn-small:hover {
    background: #005a87;
}

.garage-btn-small.garage-btn-danger {
    background: #dc3545;
}

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

/* Forms */
.owner-form-container,
.space-form-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.owner-form,
.space-form {
    max-width: 500px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.form-row small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Tables */
.garage-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
}

.garage-table thead {
    background: #f5f5f5;
}

.garage-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.garage-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.garage-table td.right,
.garage-table th.right,
td.right,
th.right {
    text-align: right;
    justify-content: end !important;
}

.garage-table tbody tr:hover {
    background: #f9f9f9;
}

.garage-owners-list-container,
.garage-table-container {
    overflow-x: auto;
}

.owner-search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* Owners List */
.owners-list-items {
    list-style: none;
    padding: 0 !important;
    margin: 20px 0 0 0 !important;
}

.owners-list-items li {
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.owners-list-items li strong {
    color: #333;
    font-size: 16px;
}

.owners-list-items li span {
    color: #666;
    font-size: 14px;
}

/* Loading Overlay */
.garage-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.garage-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Messages */
.garage-message {
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: 500;
}

.garage-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.garage-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .garage-manager-container {
        padding: 20px;
    }

    .garage-item {
        padding: 20px;
    }

    .garage-stats {
        flex-direction: column;
        gap: 10px;
    }

    .garage-table {
        margin-top: 20px !important;
        font-size: 14px;
    }

    .garage-table.spaces-table {
        margin-top: 20px !important;
        min-width: 100%;
        width: auto;
    }

    .garage-table.spaces-table th,
    .garage-table.spaces-table td {
        white-space: nowrap;
    }

    .garage-table th,
    .garage-table td {
        padding: 8px;
    }

    .form-actions {
        flex-direction: column;
    }

    .garage-btn {
        width: 100%;
    }

    .garage-space-header {
        flex-direction: row;
        align-items: flex-start !important;
        gap: 15px;
    }

    .form-row-inline {
        flex-direction: column;
    }

    .availability-dates {
        flex-direction: column;
    }

    .availability-items li {
        flex-direction: column;
        gap: 15px;
    }

    .availability-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .owner-search-container {
        flex-direction: column;
    }
}

/* ============================================
   ESTILOS PARA PLAZAS DE PROPIETARIOS
   ============================================ */

/* Tarjeta de plaza de garaje */
.garage-space-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.garage-space-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.garage-space-info h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

/* Formulario de disponibilidad */
.availability-form-container {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.availability-form h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.form-row-inline {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-inline .form-group {
    flex: 1;
}

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

.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="datetime-local"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Lista de disponibilidades */
.availability-list {
    margin-top: 20px;
}

.availability-list h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.no-availability {
    color: #6c757d;
    font-style: italic;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.availability-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.availability-items li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.availability-dates {
    display: flex;
    gap: 30px;
}

.availability-dates span {
    color: #2e7d32;
}

.availability-dates strong {
    color: #1b5e20;
    margin-right: 5px;
}

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

/* Estilos de edición */
.availability-form[data-availability-id] {
    border-left: 4px solid #0073aa;
}

/* ============================================
   ESTILOS PARA BÚSQUEDA Y RESERVA
   ============================================ */

/* Formulario de búsqueda */
.search-form-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.search-form-container h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

/* Resultados de búsqueda */
.search-results {
    margin-top: 30px;
}

.search-results h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-badge {
    font-size: 13px;
    font-weight: normal;
    color: #666;
    background: #e9ecef;
    padding: 5px 12px;
    border-radius: 4px;
}

/* Tarjetas de resultados */
.search-result-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.search-result-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.result-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.result-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.exact-badge {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.approximate-badge {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.result-info {
    margin-bottom: 15px;
}

.result-info p {
    margin: 8px 0;
    color: #555;
}

.result-info strong {
    color: #333;
}

.reserve-space {
    width: 100%;
}

.reserve-space.reserved {
    background: #4caf50;
    border-color: #4caf50;
    cursor: not-allowed;
}

.reserve-space.reserved:hover {
    background: #45a049;
    border-color: #45a049;
}

@media (max-width: 768px) {
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .search-results h3 {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   MIS RESERVAS
   ============================================ */

.my-reservations-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.my-reservations-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
}

.reservations-list {
    display: grid;
    gap: 15px;
}

.reservation-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.reservation-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.1);
}

.reservation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.reservation-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.status-confirmed {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.reservation-info {
    margin-bottom: 15px;
}

.reservation-info p {
    margin: 0 !important;
    color: #555;
    font-size: 14px;
}

.reservation-info strong {
    color: #333;
}

.garage-btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-color: #f44336;
}

.garage-btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    border-color: #d32f2f;
}

@media (max-width: 768px) {
    .reservation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ============================================
   EDICIÓN INLINE DE PLAZAS
   ============================================ */

.inline-edit-row {
    background: #f8f9fa;
}

.inline-edit-row td {
    padding: 20px !important;
}

.inline-edit-content {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group-inline {
    flex: 1;
    min-width: 150px;
}

.form-group-inline label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.form-group-inline input,
.form-group-inline select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions-inline {
    display: flex;
    gap: 10px;
}

.form-actions-inline button {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .garage-space-card {
        padding: 15px;
    }

    .inline-edit-content {
        flex-direction: column;
    }

    .form-group-inline {
        width: 100%;
    }

    .form-actions-inline {
        width: 100%;
    }

    .form-actions-inline button {
        flex: 1;
    }
}

/* Sorting Styles */
.sortable:hover {
    background-color: #eee;
}

.sort-icon::after {
    content: '↕';
    margin-left: 5px;
    font-size: 12px;
    color: #999;
}

.sortable.asc .sort-icon::after {
    content: '↑';
    color: #333;
}

.sortable.desc .sort-icon::after {
    content: '↓';
    color: #333;
}

/* Tab Icons and Mobile Styles */
.garage-tab-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.garage-tab-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

@media (max-width: 768px) {
    .garage-manager-tabs {
        justify-content: space-between;
    }

    .garage-tab-button {
        padding: 10px;
        flex: 1;
    }

    .garage-tab-button .tab-text {
        display: none;
    }

    .garage-tab-content h2 {
        display: block;
    }

    .garage-tab-button .dashicons {
        font-size: 24px;
        /* Larger touch target on mobile */
        width: 24px;
        height: 24px;
        margin: 0;
    }
}

/* ============================================
   CUSTOM CALENDAR STYLES
   ============================================ */

.custom-calendar-modal {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
    padding: 0 !important;
    /* Override container padding */
    overflow: hidden;
    border: 1px solid #e1e4e8;
    display: none;
    /* Controlled by JS */
}

.calendar-wrapper {
    display: flex;
    flex-wrap: wrap;
    min-height: 480px;
}

/* --- Custom Calendar Lateral Panel --- */
.custom-calendar-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    /* Hidden by default */
    justify-content: flex-end;
    /* Align to right */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-calendar-popup-overlay.active {
    display: flex;
    /* Activate */
    opacity: 1;
}

.custom-calendar-popup-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    height: 100%;
    /* Full height */
    max-height: none;
    border-radius: 0;
    /* No radius */
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    /* Start off-screen */
    transition: transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.custom-calendar-popup-overlay.active .custom-calendar-popup-content {
    transform: translateX(0);
    /* Slide in */
}

/* Header & Quick Ranges */
.popup-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.popup-header h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.quick-ranges-horizontal {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-start;
    /* Left align in panel? or center? Center is fine */
    flex-wrap: wrap;
    gap: 10px;
}

.quick-ranges-horizontal li {
    font-size: 12px;
    color: #007cba;
    cursor: pointer;
    background: #fff;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 12px;
    transition: all 0.2s;
}

.quick-ranges-horizontal li:hover,
.quick-ranges-horizontal li.active {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* Body: Column for panel */
.popup-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    /* contain scrolls */
    flex-direction: column;
    /* Stack vertically in panel */
    padding: 0;
    overflow-y: auto;
    /* Scroll whole body */
}

/* Calendar Section */
.calendar-section {
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid #eee;
    flex: none;
    /* Auto height */
    display: flex;
    flex-direction: column;
}

/* Time Section */
.time-section {
    padding: 0;
    flex: none;
    height: 300px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: row;
}

.time-col {
    flex: 1;
    border-left: 1px solid #eee;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.time-col:first-child {
    border-left: none;
}

.time-col label {
    padding: 10px 15px;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.time-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.time-option {
    padding: 8px 15px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.time-option:hover {
    background: #e8f4fd;
}

.time-option.selected {
    background: #007cba;
    color: #fff;
}

.manual-time-input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-top: 1px solid #eee;
    font-size: 14px;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Footer always at bottom? */
.popup-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    gap: 20px;
}

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

.current-month-label {
    font-weight: bold;
    font-size: 14px;
}

.cal-nav {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    padding: 0 5px;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-bottom: 5px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    flex: 1;
}

.calendar-days .day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.15s ease;
}

.calendar-days .day:hover:not(.disabled):not(.empty) {
    background: #e8f4fd;
}

.calendar-days .day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-days .day.empty {
    cursor: default;
}

.calendar-days .day.selected,
.calendar-days .day.selected-start,
.calendar-days .day.selected-end {
    background: #007cba;
    color: #fff;
}

.calendar-days .day.in-range {
    background: #d4edfc;
    color: #007cba;
}

/* ============================================
   AVAILABLE SPACES LIST
   ============================================ */

.available-spaces-section {
    margin-top: 30px;
}

.available-spaces-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.available-space-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.space-card-header h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.owner-badge {
    background: #e8f4fd;
    color: #0073aa;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.availability-blocks {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.availability-label {
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.availability-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.availability-period {
    flex: 1;
}

.period-dates {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.period-dates strong {
    color: #666;
}

.availability-block .garage-btn {
    white-space: nowrap;
}

@media (max-width: 600px) {
    .availability-block {
        flex-direction: column;
        align-items: stretch;
    }

    .availability-block .garage-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   BOOKING MODAL
   ============================================ */

.booking-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.booking-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.booking-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    border-radius: 12px 12px 0 0;
}

.booking-modal-header h4 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #333;
}

.booking-space-info {
    color: #666;
    font-size: 14px;
}

.booking-modal-body {
    padding: 20px;
}

.booking-availability-info {
    background: #e8f4fd;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.booking-availability-info p {
    margin: 0;
    font-size: 14px;
    color: #0073aa;
}

.availability-range {
    margin-top: 5px !important;
}

.booking-form .form-row-inline {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.booking-form .form-group {
    flex: 1;
    min-width: 200px;
}

.booking-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.booking-form input[type="datetime-local"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.booking-form input[type="datetime-local"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.booking-error-message {
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    border-radius: 6px;
    padding: 12px 15px;
    margin-top: 15px;
}

.booking-error-message .error-text {
    margin: 0;
    color: #cc0000;
    font-size: 14px;
}

.booking-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.booking-modal-footer .garage-btn {
    min-width: 120px;
}

@media (max-width: 500px) {
    .booking-modal-footer {
        flex-direction: column;
    }

    .booking-modal-footer .garage-btn {
        width: 100%;
    }
}

/* =========================================
   Owner Booking Management Styles
   ========================================= */

.garage-space-header.condensed-header {
    align-items: center;
}

.garage-name-subtitle {
    font-size: 0.9em;
    color: #666;
    margin-top: 0px;
}

.garage-space-info h3 {
    margin-top: 0px !important;
}

.garage-btn-icon {
    min-height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    min-width: 40px;
    padding: 10px 20px;
    width: 80px;
}

.garage-btn-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin: 0;
}

/* Availability Table */
.availability-table-container {
    margin-top: 20px;
    overflow-x: auto;
}

.availability-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.availability-table th,
.availability-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.availability-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.availability-table tr:last-child td {
    border-bottom: none;
}

.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: end !important;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    color: #555;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-btn:hover {
    background-color: #f0f0f1;
    color: #0073aa;
}

.icon-btn:focus {
    background-color: greenyellow;
}

.icon-btn.delete-availability:hover {
    color: #d63638;
    background-color: #ffe6e6;
}

.icon-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    background: none !important;
}

/* Expandable Booking Panel */
.bookings-details-row td {
    padding: 0;
    border-bottom: 1px solid #e5e5e5;
    background-color: #fcfcfc;
}

.bookings-panel {
    padding: 20px;
    border-top: 1px solid #eee;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.booking-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 10px;
}

.booking-item-row.status-confirmed {
    border-left: 4px solid #46b450;
}

.booking-item-row.status-pending {
    border-left: 4px solid #ffb900;
}

.booking-item-row.status-rejected {
    border-left: 4px solid #d63638;
    opacity: 0.7;
}

.booking-info {
    flex: 1;
}

.booking-user {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    color: #005a87
}

.booking-time {
    font-size: 0.9em;
    color: #666;
}

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

.booking-actions .icon-btn {
    border: 1px solid #ddd;
}

.booking-actions .icon-btn.approve-booking:hover {
    background-color: #e6f7e6;
    color: #46b450;
    border-color: #46b450;
}

.booking-actions .icon-btn.reject-booking:hover {
    background-color: #ffe6e6;
    color: #d63638;
    border-color: #d63638;
}

.booking-status-label {
    font-size: 0.85em;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.booking-status-label.confirmed {
    background: #e6f7e6;
    color: #46b450;
}

.booking-status-label.pending {
    background: #fff8e5;
    color: #ffb900;
}

.booking-status-label.rejected {
    background: #ffe6e6;
    color: #d63638;
}

.protected-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    color: #666;
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* ============================================
   PROFILE SECTION STYLES
   ============================================ */

.profile-form-container {
    max-width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    border: 1px solid #e8e8e8;
}

.profile-form-container .form-row {
    margin-bottom: 24px;
}

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

.profile-form-container input[type="text"],
.profile-form-container input[type="email"],
.profile-form-container input[type="tel"],
.profile-form-container input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.profile-form-container input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.1);
    outline: none;
}

.profile-form-container input.readonly-input {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #e9ecef;
}

.profile-form-container h3 {
    margin: 40px 0 12px 0;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-form-container .description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.2;
}

.profile-form-container .form-row-inline {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-form-container .form-row-inline .form-group {
    flex: 1;
}

.profile-form-container .form-actions {
    margin-top: 30px;
    padding-top: 20px;
}

.profile-form-container .garage-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

@media (max-width: 768px) {
    .profile-form-container {
        padding: 25px 20px;
        border-radius: 8px;
    }

    .profile-form-container .form-row-inline {
        flex-direction: column;
        gap: 0;
    }

    .profile-form-container .form-row-inline .form-group {
        margin-bottom: 24px;
    }

    .profile-form-container h3 {
        margin-top: 30px;
        padding-top: 25px;
    }

    .profile-form-container .garage-btn-primary {
        width: 100%;
    }

    .availability-table thead {
        display: none;
    }

    .availability-row {
        display: flex;
        flex-direction: column;
        padding: 10px;
        border-bottom: 1px solid #e0e0e0;
    }

    .availability-row td:nth-child(1)::before {
        content: "Del: ";
        font-weight: 600;
        margin-right: 5px;
    }

    .availability-row td:nth-child(2)::before {
        content: "Hasta: ";
        font-weight: 600;
        margin-right: 5px;
    }

    .availability-row td {
        display: block;
        width: 100%;
        padding: 4px 0;
        border: none;
        text-align: left;
    }

    .availability-row .actions-cell {
        display: flex;
        flex-direction: row;
        justify-content: flex-end !important;
        padding-top: 8px;
        margin-top: 4px;
    }
}

/* Electric Charger Badge */
.electric-charger-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: #28a745;
    vertical-align: middle;
    cursor: help;
}

.electric-charger-badge svg {
    width: 20px;
    height: 20px;
}

.garage-space-header h3 .electric-charger-badge {
    margin-left: 10px;
}

.search-result-card h4 .electric-charger-badge {
    margin-left: 8px;
}

/* Checkbox Form Row */
.form-row-checkbox label,
.form-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-row-checkbox input[type="checkbox"],
.form-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}