/* vessels/assets/css/vessels-calendar.css */

/* ── WRAPPER ───────────────────────────────────────────────────────────────── */
.vessels-cal {
	position: relative;
	user-select: none;
}

/* ── NAV ROW ───────────────────────────────────────────────────────────────── */
.vessels-cal__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.vessels-cal__heading {
	font-size: 15px;
	font-weight: 700;
	color: #1a3c5e;
	text-align: center;
	flex: 1;
}
.vessels-cal__prev,
.vessels-cal__next {
	width: 32px;
	height: 32px;
	border: 1px solid #d0d8e4;
	border-radius: 50%;
	background: #fff;
	color: #1a3c5e;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s, border-color .15s;
	flex-shrink: 0;
}
.vessels-cal__prev:hover:not(:disabled),
.vessels-cal__next:hover:not(:disabled) {
	background: #f0f4f8;
	border-color: #1a3c5e;
}
.vessels-cal__prev--disabled,
.vessels-cal__prev:disabled,
.vessels-cal__next:disabled {
	opacity: .35;
	cursor: not-allowed;
}

/* ── GRID ──────────────────────────────────────────────────────────────────── */
.vessels-cal__grid { overflow: hidden; }

.vessels-cal__day-names {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	margin-bottom: 4px;
}
.vessels-cal__day-name {
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: #aaa;
	padding: 4px 0;
}

.vessels-cal__days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 3px;
}

/* ── DAY CELL BASE ─────────────────────────────────────────────────────────── */
.vessels-cal__day {
	aspect-ratio: 1;
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: 600;
	color: #333;
	position: relative;
	min-width: 0;
	padding: 2px;
	background: #fafafa;
	border: 1px solid transparent;
	transition: background .15s, border-color .15s, color .15s;
}
.vessels-cal__day-num { line-height: 1; }
.vessels-cal__day-sub {
	font-size: 9px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .3px;
	line-height: 1.2;
	margin-top: 2px;
	text-align: center;
}

/* ── EMPTY CELL ────────────────────────────────────────────────────────────── */
.vessels-cal__day--empty { background: transparent; border-color: transparent; }

/* ── PAST ──────────────────────────────────────────────────────────────────── */
.vessels-cal__day--past {
	color: #ccc;
	background: #fafafa;
	cursor: not-allowed;
}

/* ── CLOSED / BLOCKED ──────────────────────────────────────────────────────── */
.vessels-cal__day--closed,
.vessels-cal__day--blocked {
	color: #bbb;
	background: #f0f0f0;
	cursor: not-allowed;
}
.vessels-cal__day--closed  .vessels-cal__day-sub,
.vessels-cal__day--blocked .vessels-cal__day-sub { color: #bbb; }

/* ── BOOKED (fully taken) ──────────────────────────────────────────────────── */
.vessels-cal__day--booked {
	background: #fde8e8;
	color: #c0392b;
	cursor: not-allowed;
}
.vessels-cal__day--booked .vessels-cal__day-sub { color: #c0392b; }

/* ── PARTIAL (one charter type available) ──────────────────────────────────── */
.vessels-cal__day--partial {
	background: #fff8e6;
	border-color: #f0ad4e;
	color: #856404;
	cursor: pointer;
}
.vessels-cal__day--partial .vessels-cal__day-sub { color: #a07030; }
.vessels-cal__day--partial:hover {
	background: #fff0cc;
	border-color: #e09932;
}

/* ── AVAILABLE ─────────────────────────────────────────────────────────────── */
.vessels-cal__day--available {
	background: #eaf7ee;
	border-color: #a8d5b5;
	color: #1a5c30;
	cursor: pointer;
}
.vessels-cal__day--available:hover {
	background: #c8ecd3;
	border-color: #27ae60;
}

/* ── SELECTABLE (shared hover ring) ───────────────────────────────────────── */
.vessels-cal__day--selectable:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(26,60,94,.25);
}

/* ── SELECTED ──────────────────────────────────────────────────────────────── */
.vessels-cal__day--selected {
	background: #1a3c5e !important;
	border-color: #1a3c5e !important;
	color: #fff !important;
	box-shadow: 0 2px 8px rgba(26,60,94,.25);
}
.vessels-cal__day--selected .vessels-cal__day-sub { color: rgba(255,255,255,.75) !important; }

/* ── TODAY RING ────────────────────────────────────────────────────────────── */
.vessels-cal__day--today:not(.vessels-cal__day--selected) {
	box-shadow: inset 0 0 0 2px #1a3c5e;
}
.vessels-cal__day--today .vessels-cal__day-num { font-weight: 900; }

/* ── LOADING SKELETON ──────────────────────────────────────────────────────── */
.vessels-cal__day--loading {
	background: #f0f2f5;
	border-color: transparent;
	animation: vessels-cal-pulse 1.2s ease-in-out infinite;
}
.vessels-cal__day--loading .vessels-cal__day-num { color: transparent; }

@keyframes vessels-cal-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: .45; }
}

/* ── SPINNER OVERLAY ───────────────────────────────────────────────────────── */
.vessels-cal__spinner {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,.7);
	border-radius: 8px;
	font-size: 13px;
	color: #888;
	pointer-events: none;
}
.vessels-cal__spinner::before {
	content: '';
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid #ccc;
	border-top-color: #1a3c5e;
	border-radius: 50%;
	animation: vessels-spin .7s linear infinite;
	margin-right: 8px;
}
@keyframes vessels-spin { to { transform: rotate(360deg); } }

/* ── ERROR STATE ───────────────────────────────────────────────────────────── */
.vessels-cal__error {
	padding: 12px;
	color: #a93226;
	font-size: 13px;
	text-align: center;
	grid-column: 1 / -1;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
	.vessels-cal__day      { font-size: 11px; }
	.vessels-cal__day-sub  { font-size: 8px; }
	.vessels-cal__day-name { font-size: 10px; }
}
