/**
 * Club Tir Séances — calendar and modal styles.
 *
 * @package ClubTir\Seances
 */

/* ============================================================
   Calendar container
   ============================================================ */

#cts-calendar {
	max-width: 1100px;
	margin: 0 auto 2rem;
	font-family: inherit;
}

/* ============================================================
   Modal overlay
   ============================================================ */

.cts-modal {
	position:        fixed;
	inset:           0;
	display:         flex;
	align-items:     center;
	justify-content: center;
	z-index:         99999;
}

.cts-modal-overlay {
	position:   absolute;
	inset:      0;
	background: rgba( 0, 0, 0, 0.55 );
	cursor:     pointer;
}

/* ============================================================
   Modal dialog
   ============================================================ */

.cts-modal-dialog {
	position:         relative;
	z-index:          1;
	background:       #fff;
	border-radius:    8px;
	box-shadow:       0 8px 32px rgba( 0, 0, 0, 0.22 );
	width:            min( 540px, 92vw );
	max-height:       85vh;
	overflow-y:       auto;
	padding:          2rem;
}

.cts-modal-close {
	position:    absolute;
	top:         0.75rem;
	right:       0.75rem;
	background:  transparent;
	border:      none;
	font-size:   1.5rem;
	line-height: 1;
	cursor:      pointer;
	color:       #555;
	padding:     0.25rem 0.5rem;
	border-radius: 4px;
}

.cts-modal-close:hover,
.cts-modal-close:focus {
	background: #f0f0f0;
	outline:    2px solid currentColor;
}

.cts-modal-title {
	margin:      0 2rem 1rem 0;
	font-size:   1.25rem;
	font-weight: 600;
	color:       #222;
}

.cts-modal-body p {
	margin:     0 0 0.5rem;
	color:      #444;
	font-size:  0.95rem;
}

/* ============================================================
   Booking form
   ============================================================ */

.cts-booking-form {
	margin-top:  1.5rem;
	padding-top: 1.25rem;
	border-top:  1px solid #e5e5e5;
}

.cts-booking-form h3 {
	margin:     0 0 1rem;
	font-size:  1rem;
	font-weight: 600;
}

.cts-booking-form label {
	display:     flex;
	align-items: center;
	gap:         0.75rem;
	font-size:   0.95rem;
	margin-bottom: 1rem;
}

.cts-booking-form input[type="number"] {
	width:        4rem;
	padding:      0.3rem 0.5rem;
	border:       1px solid #ccc;
	border-radius: 4px;
	font-size:    0.95rem;
	text-align:   center;
}

#cts-book-btn {
	background:    #3498DB;
	color:         #fff;
	border:        none;
	padding:       0.6rem 1.5rem;
	border-radius: 4px;
	font-size:     0.95rem;
	font-weight:   600;
	cursor:        pointer;
	transition:    background 0.2s;
}

#cts-book-btn:hover,
#cts-book-btn:focus {
	background: #2980b9;
}

#cts-book-btn:disabled {
	background: #aaa;
	cursor:     not-allowed;
}

/* ============================================================
   Booking feedback
   ============================================================ */

.cts-booking-feedback {
	margin-top:   1rem;
	padding:      0.75rem 1rem;
	border-radius: 4px;
	font-size:    0.9rem;
}

.cts-feedback-success {
	background: #eafaf1;
	border:     1px solid #27ae60;
	color:      #1a7a40;
}

.cts-feedback-error {
	background: #fdedec;
	border:     1px solid #e74c3c;
	color:      #a93226;
}

/* ============================================================
   List mode (#cts-liste)
   ============================================================ */

.cts-liste-wrap {
	max-width:   900px;
	font-family: inherit;
	font-size:   0.95rem;
}

/* Loading / empty / error states */

.cts-liste-loading,
.cts-liste-empty,
.cts-liste-error {
	padding:   1.5rem 0;
	color:     #666;
	font-style: italic;
}

.cts-liste-error { color: #a93226; }

/* Day group */

.cts-liste-day {
	margin-bottom: 2rem;
}

.cts-liste-day-header {
	font-size:     1rem;
	font-weight:   700;
	text-transform: capitalize;
	color:         #222;
	margin:        0 0 0.6rem;
	padding:       0 0 0.4rem;
	border-bottom: 2px solid #dde4ee;
}

/* Session row */

.cts-liste-item {
	display:       flex;
	align-items:   center;
	gap:           0.9rem;
	background:    #fff;
	border:        1px solid #e5e8f0;
	border-radius: 6px;
	padding:       0.7rem 1rem;
	margin-bottom: 0.45rem;
	flex-wrap:     wrap;
	transition:    box-shadow 0.15s;
}

.cts-liste-item:hover {
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.07 );
}

/* Stand colour dot */

.cts-liste-stand-dot {
	width:       12px;
	height:      12px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* Info block (stand name + time + instructor) */

.cts-liste-info {
	display:        flex;
	flex-direction: column;
	gap:            0.15rem;
	flex:           1;
	min-width:      0;
}

.cts-liste-stand {
	font-weight: 600;
	color:       #222;
}

.cts-liste-time {
	font-size: 0.9rem;
	color:     #444;
}

.cts-liste-instructor {
	font-size: 0.82rem;
	color:     #777;
}

/* Right block (status badge + slots + book button) */

.cts-liste-right {
	display:     flex;
	align-items: center;
	gap:         0.7rem;
	flex-wrap:   wrap;
	flex-shrink: 0;
}

/* Status badges */

.cts-liste-badge {
	font-size:     0.78rem;
	font-weight:   600;
	padding:       0.2rem 0.55rem;
	border-radius: 999px;
	white-space:   nowrap;
}

.cts-badge--scheduled {
	background: #eaf0fb;
	color:      #2c5fac;
}

.cts-badge--opened {
	background: #eafaf1;
	color:      #1a7a40;
}

.cts-badge--closed {
	background: #f5f5f5;
	color:      #666;
}

/* Slots */

.cts-liste-slots {
	font-size:  0.85rem;
	color:      #555;
	white-space: nowrap;
}

.cts-slots-full {
	color:      #c0392b;
	font-weight: 600;
}

/* Book button (inline) */

.cts-liste-book-btn {
	background:    #3498DB;
	color:         #fff;
	border:        none;
	padding:       0.35rem 0.85rem;
	border-radius: 4px;
	font-size:     0.85rem;
	font-weight:   600;
	cursor:        pointer;
	white-space:   nowrap;
	transition:    background 0.15s;
}

.cts-liste-book-btn:hover,
.cts-liste-book-btn:focus {
	background: #2980b9;
	outline:    2px solid #1a5e8a;
}

/* Already-booked indicator (replaces the blue Réserver button) */

.cts-liste-booked-btn {
	background:    #27ae60;
	color:         #fff;
	border:        none;
	padding:       0.35rem 0.85rem;
	border-radius: 4px;
	font-size:     0.85rem;
	font-weight:   600;
	white-space:   nowrap;
	cursor:        default;
	opacity:       1;
}

/* Override browser's default greying-out of :disabled buttons. */
.cts-liste-booked-btn:disabled {
	background: #27ae60;
	color:      #fff;
	opacity:    1;
}

/* ============================================================
   Guests section (inside booking form)
   ============================================================ */

.cts-guests-section {
	margin-bottom: 1.25rem;
}

.cts-guests-header {
	display:     flex;
	align-items: center;
	gap:         0.75rem;
	margin-bottom: 0.6rem;
}

.cts-guests-label {
	font-size:   0.95rem;
	font-weight: 600;
	color:       #333;
	flex:        1;
}

.cts-add-guest-btn {
	background:    #3498DB;
	color:         #fff;
	border:        none;
	width:         2rem;
	height:        2rem;
	border-radius: 50%;
	font-size:     1.3rem;
	line-height:   1;
	cursor:        pointer;
	flex-shrink:   0;
	transition:    background 0.15s;
	display:       flex;
	align-items:   center;
	justify-content: center;
}

.cts-add-guest-btn:hover,
.cts-add-guest-btn:focus {
	background: #2980b9;
	outline:    2px solid #1a5e8a;
}

.cts-add-guest-btn:disabled {
	background: #bbb;
	cursor:     not-allowed;
}

.cts-guests-list {
	display:        flex;
	flex-direction: column;
	gap:            0.5rem;
}

.cts-guest-row {
	display:   flex;
	gap:       0.5rem;
	align-items: center;
}

.cts-guest-firstname,
.cts-guest-lastname {
	flex:          1;
	padding:       0.35rem 0.5rem;
	border:        1px solid #ccc;
	border-radius: 4px;
	font-size:     0.92rem;
	min-width:     0;
}

.cts-guest-firstname:focus,
.cts-guest-lastname:focus {
	border-color: #3498DB;
	outline:      2px solid #a8d4f0;
}

.cts-remove-guest-btn {
	background:  transparent;
	border:      none;
	color:       #999;
	font-size:   1.3rem;
	line-height: 1;
	cursor:      pointer;
	padding:     0 0.2rem;
	flex-shrink: 0;
	transition:  color 0.15s;
}

.cts-remove-guest-btn:hover,
.cts-remove-guest-btn:focus {
	color:   #c0392b;
	outline: none;
}

/* ============================================================
   Calibers field (inside booking form)
   ============================================================ */

.cts-calibers-field {
	margin-bottom: 1rem;
}

.cts-calibers-label {
	margin:      0 0 0.4rem;
	font-size:   0.95rem;
	font-weight: 600;
	color:       #333;
}

.cts-calibers-list {
	display:   flex;
	flex-wrap: wrap;
	gap:       0.4rem 1rem;
}

.cts-caliber-label {
	display:     flex;
	align-items: center;
	gap:         0.35rem;
	font-size:   0.92rem;
	font-weight: normal;
	color:       #444;
	cursor:      pointer;
	margin-bottom: 0;
}

.cts-caliber-label input[type="checkbox"] {
	width:  auto;
	margin: 0;
	cursor: pointer;
	accent-color: #3498DB;
}

.cts-caliber-other-label {
	flex-basis: 100%;
	margin-top: 0.3rem;
}

.cts-caliber-other {
	flex:          1;
	padding:       0.3rem 0.5rem;
	border:        1px solid #ccc;
	border-radius: 4px;
	font-size:     0.92rem;
	min-width:     0;
}

/* ============================================================
   Cancelled events
   ============================================================ */

.fc-event.fc-event-cancelled {
	opacity:         0.6;
	text-decoration: line-through;
}

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

@media ( max-width: 600px ) {
	.cts-modal-dialog {
		padding: 1.25rem;
	}

	#cts-calendar {
		font-size: 0.85rem;
	}
}

/* ============================================================
   Initiation sessions / booking lock
   ============================================================ */

.cts-badge--initiation {
	background: #e8f0fe;
	color:      #1a56c4;
}

.cts-liste-locked {
	font-size: 0.8rem;
	color:     #8a5a00;
	cursor:    help;
}

.cts-modal-initiation {
	padding:       0.6rem 0.8rem;
	border-left:   3px solid #dba617;
	background:    #fef8ec;
	color:         #7a5b00;
	font-size:     0.9rem;
	border-radius: 3px;
}
