/* Ajustement pour la navbar fixe */
body {
    padding-top: 70px; /* Hauteur de la navbar + un peu d'espace */
    background-color: #59ce72;  /* ou une autre couleur de votre choix */
}

.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.ics-management {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.ics-source {
    margin-bottom: 1rem;
}

.source-inputs {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.source-inputs input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.platform-name {
    width: 200px;
}

.ics-url {
    flex-grow: 1;
}

.remove-source {
    background: #ff4444;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-controls {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.buttons-row {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: #545b62;
}

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

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

.btn-success {
    background: #28a745;
    color: white;
}

.sync-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

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

.sync-status.error {
    background: #f8d7da;
    color: #721c24;
}

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

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

.calendar-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap; /* Pour permettre le retour à la ligne sur les petits écrans */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Couleurs de la légende - correspondent aux couleurs des événements */
.legend-color.available {
    background-color: #98FB98; /* Vert clair - Dates disponibles */
}

.legend-color.confirmed {
    background-color: #28a745; /* Vert foncé - Réservation confirmée */
}

.legend-color.pending {
    background-color: #ffc107; /* Orange - Réservation en attente */
}

.legend-color.blocked {
    background-color: #dc3545; /* Rouge - Dates bloquées */
}

.legend-color.cancelled {
    background-color: #6c757d; /* Gris - Réservation annulée */
}

/* Légende du calendrier - Configuration des couleurs */
/* Couleurs des états du calendrier
 * --------------------------------
 * Disponible : Vert (#28a745)
 * Réservé : Rose/Rouge (#e83e8c)
 * 
 * Note : Ces couleurs sont utilisées à la fois dans la légende
 * et dans les événements du calendrier lui-même (.fc-event)
 */
.legend-color.available {
    background-color: #28a745; /* Vert - Dates disponibles */
}

.legend-color.booked {
    background-color: #e83e8c; /* Rose/Rouge - Dates réservées */
}

#calendar {
    height: 600px;
}

/* Styles des événements dans le calendrier FullCalendar
 * --------------------------------------------------
 * Statuts standard ICS (RFC 5545) :
 * - CONFIRMED -> confirmed (Vert foncé)
 * - TENTATIVE -> pending (Orange)
 * - CANCELLED -> cancelled (Gris)
 * 
 * Statuts additionnels :
 * - blocked (Rouge)
 * - available (Vert clair)
 */
.fc-event {
    border: none;
    padding: 2px;
}

.fc-event.confirmed {
    background-color: #28a745; /* Vert foncé - Réservation confirmée */
    border-color: #28a745;
}

.fc-event.pending {
    background-color: #ffc107; /* Orange - Réservation en attente */
    border-color: #ffc107;
}

.fc-event.cancelled {
    background-color: #6c757d; /* Gris - Réservation annulée */
    border-color: #6c757d;
}

.fc-event.blocked {
    background-color: #dc3545; /* Rouge - Dates bloquées */
    border-color: #dc3545;
}

.fc-event.available {
    background-color: #98FB98; /* Vert clair - Dates disponibles */
    border-color: #98FB98;
}

/* Style pour les événements dans le calendrier */
/* Styles pour la carte des réservations */
.reservations-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.reservations-card h3 {
    margin: 0 0 1.5rem 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Filtres */
.filters-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.search-box {
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-options select {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.reservations-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    display: block;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stat-info {
    display: block;
    font-size: 0.9rem;
    color: var(--secondary-color);
    line-height: 1.4;
}

.reservations-list {
    max-height: 300px;
    overflow-y: auto;
}

.reservation-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid #eee;
}

.reservation-item:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.reservation-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reservation-guest {
    font-size: 0.9rem;
    color: #666;
}

.reservation-duration {
    font-size: 0.8rem;
    color: #888;
}

.booking-state {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.state-upcoming {
    background: #e3f2fd;
    color: #1976d2;
}

.state-current {
    background: #e8f5e9;
    color: #2e7d32;
}

.state-past {
    background: #f5f5f5;
    color: #616161;
}

.reservation-dates {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.reservation-date {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-label {
    font-size: 0.8rem;
    color: #666;
}

.date-value {
    font-weight: 500;
}

.reservation-source {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.source-airbnb {
    background: #ff5a5f20;
    color: #ff5a5f;
}

.source-abritel {
    background: #0077cc20;
    color: #0077cc;
}

.source-autre {
    background: #66666620;
    color: #666666;
}

/* Styles pour la page de réservation */
.reservation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.calendar-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.calendar-header {
    margin-bottom: 1.5rem;
}

.calendar-header h2 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.5rem;
}

.calendar-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.btn-warning {
    background-color: #ffa500;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-warning:hover {
    background-color: #ff8c00;
}

/* Modal de blocage */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.error-message {
    color: #dc3545;
    margin-top: 0.5rem;
    display: none;
}

.ics-url-container {
    display: flex;
    gap: 10px;
    flex: 1;
}

.ics-url-container input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #f8f9fa;
}

.ics-url-container input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Responsive design */
@media (max-width: 1024px) {
    .reservation-container {
        grid-template-columns: 1fr;
    }
}

.visitors-stats {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.stat-box h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1rem;
}

.stat-box div {
    font-size: 2rem;
    font-weight: bold;
    color: #0d6efd;
}
