/* ========================================
   ENROLLMENT PAGE - CLASS CARD GRID LAYOUT
   ======================================== */

/* CSS Custom Properties for easy theming */
:root {
    /* Theme Colors */
    --theme-primary: #e7b1af;
    --theme-secondary: #c7a168;
    --theme-primary-hover: #d99592;
    --theme-mono-1: #30271c;
    --theme-mono-2: #62513c;

    /* Card Styling */
    --card-border-radius: 16px;
    --card-shadow-base: 0 4px 12px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 12px 28px rgba(231, 177, 175, 0.25);
    --card-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --overlay-gradient: linear-gradient(to top,
            rgba(48, 39, 28, 0.95) 0%,
            rgba(48, 39, 28, 0.7) 40%,
            rgba(48, 39, 28, 0.4) 70%,
            rgba(48, 39, 28, 0) 100%);
}

/* ========================================
   GRID CONTAINER
   ======================================== */

.hemal-classes-grid {
    display: grid;
    /* Auto-fit responsive columns */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    padding: 0 20px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   CARD CONTAINER
   ======================================== */

.class-card {
    position: relative;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    background-color: #f5f5f5;
    /* Fallback background */
    aspect-ratio: 2 / 3;
    /* Vertical card - portrait orientation */
    box-shadow: var(--card-shadow-base);
    transition: var(--card-transition);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

/* Hover effect - lift and enhance shadow */
.class-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

/* ========================================
   CARD BACKGROUND IMAGE
   ======================================== */

.class-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle zoom on hover */
.class-card:hover .class-card-bg {
    transform: scale(1.1);
}

/* Placeholder gradient for cards without images */
.class-card-placeholder {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
}

/* ========================================
   GRADIENT OVERLAY
   ======================================== */

.class-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75%;
    /* Cover lower portion for text readability */
    background: var(--overlay-gradient);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

/* ========================================
   CARD CONTENT
   ======================================== */

.class-card-content {
    position: relative;
    z-index: 3;
    color: white;
}

/* Card title - bold white text */
.class-card-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 12px 0;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.02em;
}

/* Card description */
.class-card-description {
    display: block;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    height: 3.5em;
    /* Approximately 2-3 lines of text */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scrollbar for description if it overflows */
.class-card-description::-webkit-scrollbar {
    width: 4px;
}

.class-card-description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.class-card-description::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* List styles within description */
.class-card-description ul,
.class-card-description ol {
    margin: 8px 0;
    padding-left: 20px;
    list-style-position: outside;
}

.class-card-description li {
    margin-bottom: 4px;
}

.class-card-description ul {
    list-style-type: disc;
}

.class-card-description ol {
    list-style-type: decimal;
}

/* Metadata row - duration, price, etc. */
.class-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.meta-icon {
    opacity: 0.85;
    font-size: 1rem;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Desktop: 3-4 cards per row (handled by auto-fit above) */

/* Tablet: 2 cards per row */
@media (min-width: 601px) and (max-width: 1024px) {
    .hemal-classes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 28px 16px;
    }
}

/* Mobile: 1 card per row */
@media (max-width: 600px) {
    .hemal-classes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 16px;
    }

    .class-card-title {
        font-size: 1.35rem;
    }

    .class-card-overlay {
        padding: 20px;
    }

    .class-card-meta {
        font-size: 0.85rem;
        gap: 12px;
    }
}

/* Large desktop: 4 cards per row */
@media (min-width: 1400px) {
    .hemal-classes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   CARD ACTIONS (BUTTONS)
   ======================================== */

.class-card-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-details,
.btn-register {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    font-family: inherit;
}

.btn-details {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-details:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-register {
    background: #2c3e50;
    /* Dark Slate Blue/Grey like JSPMotors */
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-register:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

/* ========================================
   MODAL STYLES
   ======================================== */

/* Prevent scrolling when modal is open */
body.modal-open {
    overflow: hidden;
    padding-right: 0px;
    /* Adjust if scrollbar causes jump */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    /* Darker overlay */
    z-index: 99999;
    /* Extremely high to stay on top */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    /* Increased blur */
    transition: opacity 0.3s ease;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    width: 95%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 20px;
    /* Buffer for mobile */
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(30px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #000;
}

.modal-content h2 {
    margin-top: 0;
    color: var(--theme-mono-1);
    margin-bottom: 5px;
}

#modal-class-name-display {
    color: var(--theme-mono-2);
    font-style: italic;
    margin-bottom: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    /* Important for padding */
}

.form-group input:focus {
    border-color: var(--theme-secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(199, 161, 104, 0.2);
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--theme-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: var(--theme-mono-2);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#reg-message {
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
}

/* Details Modal Specific Styles */
.details-modal-content {
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
    font-weight: 500;
    color: var(--theme-mono-2);
}

.details-meta p {
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-meta p::before {
    font-family: "dashicons";
    font-size: 1.2rem;
    opacity: 0.7;
}

#details-schedule::before {
    content: "\f469";
}

/* Clock icon */
#details-date::before {
    content: "\f508";
}

/* Calendar icon */
#details-location::before {
    content: "\f230";
}

/* Location icon */
#details-age::before {
    content: "\f307";
}

/* Groups icon */
#details-price::before {
    content: "\f323";
}

/* Tag icon */

.details-body {
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 25px;
    padding-right: 15px;
    line-height: 1.6;
    color: #444;
}

.details-body ul,
.details-body ol {
    padding-left: 20px;
    margin: 15px 0;
}

.details-body li {
    margin-bottom: 10px;
}

.details-body::-webkit-scrollbar {
    width: 6px;
}

.details-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.details-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.modal-actions {
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.modal-reg-trigger {
    width: 100%;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 15px 0;
}