/* Training Calendar Premium Visual Cards Styling */

.courses-list-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .courses-list-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        gap: 1.25rem !important;
    }
}

@media (max-width: 600px) {
    .courses-list-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

.course-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    width: 100% !important;
    box-sizing: border-box;
    position: relative;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
}

.course-image-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.course-image {
    height: 145px;
    background-color: #f8fafc;
    background-size: cover;
    background-position: center;
    position: relative;
    display: block;
    width: 100%;
    border-bottom: 1px solid #e2e8f0;
}

.course-badges {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

[dir="rtl"] .course-badges {
    left: auto;
    right: 12px;
}

.course-date-badge,
.course-location-badge {
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.course-date-badge i,
.course-location-badge i {
    font-size: 11px;
}

.course-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
    box-sizing: border-box;
}

.course-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin: 0;
    text-decoration: none;
    display: block;
}

.course-title:hover {
    color: var(--accent-color, #c9963a);
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 8px;
    padding-top: 0.5rem;
}

.meta-left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: #64748b;
    font-size: 0.85rem;
}

.meta-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-ghost {
    background: transparent;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #334155;
    transition: all 0.25s;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.btn-ghost:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: var(--accent-color, #c9963a);
}

/* Multiple dates indicator */
.multiple-dates-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 6px;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

[dir="rtl"] .multiple-dates-badge {
    right: auto;
    left: 12px;
}

/* Ensure calendar pilot container elements have clear margins and pointer events */
.pilot-3-months .horizontal-search-container {
    pointer-events: auto !important;
}

.pilot-3-months .departments-container {
    margin-top: -3.5rem !important; /* Pull up only the top department bar */
    margin-bottom: 1.5rem !important;
    position: relative !important;
    z-index: 60 !important;
}

.pilot-3-months .specializations-container {
    margin-top: 0 !important; /* Do not pull up the specialization bar */
    margin-bottom: 1.5rem !important;
    position: relative !important;
    z-index: 55 !important;
}

.pilot-3-months .horizontal-search-container:not(.departments-container):not(.specializations-container):not(.years-container) {
    margin-top: 0 !important; /* Do not pull up the search box */
    margin-bottom: 2.5rem !important;
    position: relative !important;
    z-index: 50 !important;
}

/* Ensure sticky container does not overlap header by removing negative margin */
.pilot-3-months .horizontal-search-container.is-sticky {
    margin-top: 0 !important;
    background-color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    border-radius: 0 0 12px 12px !important;
    padding: 1rem !important;
    z-index: 999 !important;
}

.pilot-3-months .horizontal-search-container.is-sticky .calendar-search-title {
    margin-bottom: 0.75rem !important;
}

/* On mobile, adjust the top margin for department bar */
@media (max-width: 991px) {
    .pilot-3-months .departments-container {
        margin-top: -2rem !important;
        margin-bottom: 1.5rem !important;
    }
    .pilot-3-months .specializations-container {
        margin-top: 0 !important;
        margin-bottom: 1.5rem !important;
    }
    .pilot-3-months .horizontal-search-container:not(.departments-container):not(.specializations-container):not(.years-container) {
        margin-top: 0 !important;
        margin-bottom: 1.5rem !important;
    }
}

/* Ensure input is always clickable and typeable */
#calendar-search-input {
    pointer-events: auto !important;
    cursor: text !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    background-color: #f8fafc !important;
}

#calendar-search-input:focus {
    background-color: #ffffff !important;
}

.search-group.text-group {
    pointer-events: auto !important;
    cursor: text !important;
}

/* Section Title Above Search in Stage 3 */
.calendar-search-title {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: var(--secondary-color, #0b2545) !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
    display: block !important;
    z-index: 10 !important;
}

[dir="rtl"] .calendar-search-title {
    text-align: right !important;
}

[dir="ltr"] .calendar-search-title {
    text-align: left !important;
}

/* Override the white background table container to keep visual cards transparent on the page */
.pilot-3-months .calendar-table-container {
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    border-radius: 0 !important;
    margin-top: 2rem !important;
}

/* Premium Clear Search Button */
.clear-search-btn {
    display: inline-block !important;
    margin-top: 1rem !important;
    padding: 0.6rem 1.8rem !important;
    background-color: var(--primary-color, #00478f) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s ease !important;
}

.clear-search-btn:hover {
    background-color: var(--primary-hover, #00366f) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.clear-search-btn:active {
    transform: translateY(0) !important;
}

/* Premium Year selection card buttons styles */
.pilot-3-months .years-container {
    margin-top: -3.5rem !important; /* Align exactly with department bar top offset */
    margin-bottom: 1.5rem !important;
    position: relative !important;
    z-index: 60 !important;
}

@media (max-width: 991px) {
    .pilot-3-months .years-container {
        margin-top: -2rem !important;
        margin-bottom: 1.5rem !important;
    }
}

.pilot-3-months .year-card-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border: 1px solid #e2e8f0;
    background-color: #fff;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    outline: none;
    box-sizing: border-box;
    width: auto;
}

.pilot-3-months .year-card-btn i {
    font-size: 1.4rem;
    color: var(--primary-color, #2e3d62);
    transition: color 0.2s ease;
}

.pilot-3-months .year-card-btn:hover {
    background-color: #f8fafc;
    border-color: var(--accent-color, #c9963a);
    color: var(--accent-color, #c9963a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pilot-3-months .year-card-btn.active {
    background-color: var(--primary-color, #2e3d62);
    border-color: var(--primary-color, #2e3d62);
    color: #fff;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(46, 61, 98, 0.15);
}

.pilot-3-months .year-card-btn.active i {
    color: #fff;
}

[dir="rtl"] .pilot-3-months .year-card-btn {
    text-align: right;
}

