@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
	--istaht-primary: hsv(210, 85%, 55%);
	--istaht-primary-grad: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
	--istaht-primary-hover: #0369a1;
	--istaht-accent: #0f766e;
	--istaht-accent-grad: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
	--istaht-dark: #1e293b;
	--istaht-light: #f8fafc;
	--istaht-border: #e2e8f0;
	--istaht-success: #10b981;
	--istaht-warning: #f59e0b;
	--istaht-danger: #ef4444;
	--istaht-gray-light: #64748b;
	
	--istaht-radius-sm: 8px;
	--istaht-radius-md: 16px;
	--istaht-radius-lg: 24px;
	
	--istaht-shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	--istaht-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
	--istaht-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.istaht-public-container {
	font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--istaht-dark);
	margin: 20px 0;
	width: 100%;
}

/* 1. Grid Deck for Concours */
.istaht-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 30px;
	padding: 10px 0;
}

.istaht-card {
	background: #ffffff;
	border-radius: var(--istaht-radius-md);
	border: 1px solid var(--istaht-border);
	box-shadow: var(--istaht-shadow-sm);
	overflow: hidden;
	transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
	display: flex;
	flex-direction: column;
	position: relative;
}

.istaht-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--istaht-shadow-lg);
	border-color: rgba(2, 132, 199, 0.3);
}

.istaht-card-image {
	position: relative;
	height: 200px;
	overflow: hidden;
	background-color: #f1f5f9;
}

.istaht-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.istaht-card:hover .istaht-card-image img {
	transform: scale(1.08);
}

/* Gradients for lack of thumbnails */
.placeholder-grad {
	background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.placeholder-icon {
	color: #38bdf8;
	font-size: 64px;
	opacity: 0.65;
}

.placeholder-icon span {
	width: 64px;
	height: 64px;
	font-size: 64px;
}

/* 2. Badges */
.istaht-badge {
	position: absolute;
	top: 15px;
	right: 15px;
	padding: 6px 14px;
	border-radius: 30px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	z-index: 2;
	backdrop-filter: blur(4px);
}

.status-active {
	background: rgba(16, 185, 129, 0.9);
	color: #ffffff;
}

.status-upcoming {
	background: rgba(245, 158, 11, 0.9);
	color: #ffffff;
}

.status-closed {
	background: rgba(100, 116, 139, 0.9);
	color: #ffffff;
}

/* 3. Card Body */
.istaht-card-body {
	padding: 24px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.istaht-card-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 12px 0;
	line-height: 1.4;
	color: var(--istaht-dark);
}

.istaht-dates {
	display: flex;
	gap: 15px;
	font-size: 13px;
	color: var(--istaht-gray-light);
	margin-bottom: 15px;
	border-bottom: 1px dashed var(--istaht-border);
	padding-bottom: 12px;
}

.istaht-dates p {
	margin: 0;
}

.istaht-card-content {
	font-size: 14px;
	line-height: 1.6;
	color: #475569;
	margin-bottom: 24px;
	flex-grow: 1;
}

.istaht-card-actions {
	display: flex;
	gap: 12px;
	margin-top: auto;
}

/* 4. Buttons */
.istaht-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	border-radius: var(--istaht-radius-sm);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	transition: all 0.3s ease;
	flex: 1;
	outline: none;
}

.btn-primary {
	background: var(--istaht-primary-grad);
	color: #ffffff !important;
	box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-primary:hover {
	background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

.btn-secondary {
	background: #ffffff;
	border: 1px solid var(--istaht-border);
	color: var(--istaht-dark) !important;
}

.btn-secondary:hover {
	background: var(--istaht-light);
	border-color: var(--istaht-gray-light);
	transform: translateY(-2px);
}

.btn-disabled {
	background: #cbd5e1;
	color: #94a3b8 !important;
	cursor: not-allowed;
}

.btn-block {
	width: 100%;
	display: flex;
}

/* 5. Expanding Form Drawer */
.istaht-drawer {
	margin-top: 40px;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: var(--istaht-radius-md);
	box-shadow: var(--istaht-shadow-lg);
	padding: 30px;
	animation: slideDown 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
	position: relative;
}

@keyframes slideDown {
	from { opacity: 0; transform: translateY(-20px); }
	to { opacity: 1; transform: translateY(0); }
}

.istaht-drawer-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--istaht-border);
	padding-bottom: 15px;
}

.istaht-drawer-header h4 {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--istaht-dark);
}

.istaht-close-drawer {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--istaht-gray-light);
	transition: color 0.2s;
}

.istaht-close-drawer:hover {
	color: var(--istaht-danger);
}

/* 6. Form Styles */
.istaht-glass-form {
	width: 100%;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

.form-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.form-row.full-width {
	grid-column: 1 / -1;
	margin-bottom: 20px;
}

.form-row label {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
}

.form-row .required {
	color: var(--istaht-danger);
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="date"],
.form-row select {
	padding: 12px 16px;
	border-radius: var(--istaht-radius-sm);
	border: 1px solid var(--istaht-border);
	background: #ffffff;
	font-size: 14px;
	transition: all 0.3s ease;
	outline: none;
	width: 100%;
	box-sizing: border-box;
}

.form-row input:focus,
.form-row select:focus {
	border-color: #0284c7;
	box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
	background: #ffffff;
}

/* File Drop Area */
.file-drop-area {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	border: 2px dashed #38bdf8;
	background: rgba(56, 189, 248, 0.05);
	border-radius: var(--istaht-radius-sm);
	text-align: center;
	transition: background-color 0.2s;
	cursor: pointer;
}

.file-drop-area:hover {
	background: rgba(56, 189, 248, 0.1);
}

.file-msg {
	font-size: 13px;
	color: #0369a1;
	font-weight: 500;
}

.file-input {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 100%;
	opacity: 0;
	cursor: pointer;
}

/* Spinner and Status states */
.spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.form-feedback {
	margin-top: 15px;
	padding: 12px 16px;
	border-radius: var(--istaht-radius-sm);
	font-size: 14px;
	font-weight: 500;
	animation: fadeIn 0.3s;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.form-feedback.success {
	background: rgba(16, 185, 129, 0.1);
	color: #065f46;
	border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-feedback.error {
	background: rgba(239, 68, 68, 0.1);
	color: #991b1b;
	border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 7. Results Section CSS */
.istaht-results-list {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.istaht-result-item {
	background: #ffffff;
	border-radius: var(--istaht-radius-sm);
	border: 1px solid var(--istaht-border);
	padding: 20px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	box-shadow: var(--istaht-shadow-sm);
	transition: all 0.3s ease;
}

.istaht-result-item:hover {
	box-shadow: var(--istaht-shadow-md);
	border-color: rgba(2, 132, 199, 0.25);
}

.result-info {
	flex-grow: 1;
}

.result-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 6px 0;
	color: var(--istaht-dark);
}

.associated-concours-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 600;
	background: #f1f5f9;
	color: var(--istaht-gray-light);
	padding: 3px 8px;
	border-radius: 4px;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.result-desc {
	font-size: 13px;
	color: #475569;
	margin: 6px 0 0 0;
	line-height: 1.5;
}

.result-action {
	flex-shrink: 0;
}

.no-file-tag {
	font-size: 12px;
	font-weight: 600;
	color: var(--istaht-gray-light);
	background: #f1f5f9;
	padding: 6px 12px;
	border-radius: var(--istaht-radius-sm);
}

.istaht-no-records {
	text-align: center;
	padding: 40px;
	background: var(--istaht-light);
	border: 1px dashed var(--istaht-border);
	border-radius: var(--istaht-radius-md);
	color: var(--istaht-gray-light);
	font-size: 14px;
}
