/* ==========================================================================
   Course Fund Spotlight - Nature-Inspired Organic Design
   "Supporting the grounds where champions are made"
   ========================================================================== */

/* Section Container - Earthy, grounded feel */
.course-spotlight-container {
    --spotlight-accent: #16a34a;
    --spotlight-accent-light: #22c55e;
    --spotlight-earth: #78716c;
    --spotlight-forest: #14532d;
    --spotlight-bark: #292524;

    position: relative;
    background: var(--theme-surface-1);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    overflow: hidden;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

/* Organic background texture */
.course-spotlight-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(22, 163, 74, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(22, 163, 74, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Subtle organic pattern overlay */
.course-spotlight-container::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5c13.807 0 25 11.193 25 25s-11.193 25-25 25S5 43.807 5 30 16.193 5 30 5zm0 2c-12.703 0-23 10.297-23 23s10.297 23 23 23 23-10.297 23-23S42.703 7 30 7z' fill='%2316a34a' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Header Section */
.course-spotlight-header {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--theme-border-color);
}

/* Title treatment */
.course-spotlight-title {
    position: relative;
    margin: 0 0 0.75rem 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--theme-text-primary);
    line-height: 1.2;
}

/* Decorative accent leaf */
.course-spotlight-title::before {
    content: '🌿';
    position: absolute;
    left: -2.5rem;
    top: 0.15em;
    font-size: 0.8em;
    opacity: 0.7;
    filter: grayscale(30%);
}

.course-spotlight-lede {
    max-width: 36rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--theme-text-secondary);
}

/* Header buttons */
.course-spotlight-header .d-flex {
    gap: 0.75rem;
}

/* Card Grid - Asymmetric stagger */
.course-spotlight-container .row {
    --bs-gutter-x: 2rem;
    --bs-gutter-y: 2rem;
}

/* Individual Card - Layered depth effect */
.course-spotlight-card {
    position: relative;
    background: var(--theme-surface-1);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 8px 20px -8px rgba(0, 0, 0, 0.12);
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
    border: 1px solid var(--theme-border-color);
}

/* Staggered card offsets for organic feel */
.course-spotlight-container .col-md-4:nth-child(2) .course-spotlight-card {
    transform: translateY(12px);
}

.course-spotlight-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 24px 40px -12px rgba(0, 0, 0, 0.2);
}

.course-spotlight-container .col-md-4:nth-child(2) .course-spotlight-card:hover {
    transform: translateY(4px);
}

/* Card Header with Emblem */
.course-spotlight-card__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--theme-surface-2);
    border-bottom: 1px solid var(--theme-border-color);
}

.course-spotlight-card__emblem {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--theme-surface-3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.course-spotlight-card__emblem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-spotlight-card__header-info {
    flex: 1;
    min-width: 0;
}

.course-spotlight-card__header-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--theme-text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-spotlight-card__header-info .location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--theme-text-muted);
    line-height: 1.4;
}

.course-spotlight-card__header-info .location i {
    font-size: 0.7rem;
    opacity: 0.7;
}

.course-spotlight-card__distance {
    flex-shrink: 0;
    padding: 0.375rem 0.625rem;
    background: var(--theme-surface-3);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-secondary);
}

/* Card Body */
.course-spotlight-card__body {
    position: relative;
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--theme-surface-1);
}

/* Fund Amount Section */
.course-spotlight-card__fund {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px dashed var(--theme-border-color);
}

.course-spotlight-card__amount {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--spotlight-accent) 0%, var(--spotlight-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.course-spotlight-card__label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--theme-text-muted);
}

/* Action Buttons */
.course-spotlight-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 1.25rem;
}

.course-spotlight-card__actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Primary Support Button - Nature accent */
.course-spotlight-card__actions .btn-theme-primary {
    background: linear-gradient(135deg, var(--spotlight-accent) 0%, #15803d 100%);
    border-color: var(--spotlight-accent);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.course-spotlight-card__actions .btn-theme-primary:hover {
    background: linear-gradient(135deg, var(--spotlight-accent-light) 0%, var(--spotlight-accent) 100%);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}

/* Outline Button */
.course-spotlight-card__actions .btn-theme-outline {
    border-color: var(--theme-border-color);
    color: var(--theme-text-secondary);
}

.course-spotlight-card__actions .btn-theme-outline:hover {
    background: var(--theme-surface-2);
    border-color: var(--spotlight-accent);
    color: var(--spotlight-accent);
}

/* Empty state / Loading */
.course-spotlight-card--loading {
    min-height: 320px;
}

.course-spotlight-card--loading .course-spotlight-card__image {
    animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==========================================================================
   Dark Mode Adjustments
   ========================================================================== */
[data-bs-theme="dark"] .course-spotlight-container {
    --spotlight-accent: #22c55e;
    --spotlight-accent-light: #4ade80;

    background: var(--theme-surface-1);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 20px 25px -5px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .course-spotlight-container::before {
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(34, 197, 94, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(34, 197, 94, 0.04) 0%, transparent 50%);
}

[data-bs-theme="dark"] .course-spotlight-card {
    background: var(--theme-surface-2);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.2),
        0 8px 20px -8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .course-spotlight-card:hover {
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.15),
        0 24px 40px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(34, 197, 94, 0.15);
}

[data-bs-theme="dark"] .course-spotlight-card__header {
    background: var(--theme-surface-3);
}

[data-bs-theme="dark"] .course-spotlight-card__body {
    background: var(--theme-surface-2);
}

[data-bs-theme="dark"] .course-spotlight-card__emblem {
    background: var(--theme-surface-2);
}

[data-bs-theme="dark"] .course-spotlight-card__distance {
    background: var(--theme-surface-2);
}

[data-bs-theme="dark"] .course-spotlight-card__actions .btn-theme-primary {
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
}

[data-bs-theme="dark"] .course-spotlight-card__actions .btn-theme-primary:hover {
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 992px) {
    .course-spotlight-container {
        padding: 2rem 1.75rem;
        border-radius: 20px;
    }

    .course-spotlight-title::before {
        display: none;
    }

    /* Reset stagger on tablet */
    .course-spotlight-container .col-md-4:nth-child(2) .course-spotlight-card {
        transform: none;
    }

    .course-spotlight-container .col-md-4:nth-child(2) .course-spotlight-card:hover {
        transform: translateY(-8px);
    }
}

@media (max-width: 768px) {
    .course-spotlight-container {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }

    .course-spotlight-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.75rem;
        padding-bottom: 1.5rem;
    }

    .course-spotlight-header .d-flex {
        width: 100%;
    }

    .course-spotlight-header .d-flex .btn {
        flex: 1;
    }

    .course-spotlight-card__header {
        padding: 1rem 1.25rem;
    }

    .course-spotlight-card__emblem {
        width: 48px;
        height: 48px;
    }

    .course-spotlight-card__body {
        padding: 1rem 1.25rem 1.25rem;
    }

    .course-spotlight-card__amount {
        font-size: 1.75rem;
    }

    .course-spotlight-card__actions {
        flex-direction: column;
    }

    .course-spotlight-card__actions .btn {
        width: 100%;
    }

    .course-spotlight-drawer__header {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .course-spotlight-drawer__toggle {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .course-spotlight-container {
        padding: 1.5rem 1rem;
    }

    .course-spotlight-title {
        font-size: 1.5rem;
    }

    .course-spotlight-lede {
        font-size: 0.95rem;
    }

    .course-spotlight-card {
        border-radius: 16px;
    }

    .course-spotlight-card__header-info h3 {
        font-size: 1rem;
    }

    .course-spotlight-card__distance {
        display: none;
    }

    .course-spotlight-drawer__icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .course-spotlight-drawer__title {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   Collapsible Drawer Wrapper
   ========================================================================== */
.course-spotlight-drawer {
    background: var(--theme-surface-1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 25px -5px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--theme-border-color);
}

.course-spotlight-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.75rem;
    background: var(--theme-surface-2);
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.course-spotlight-drawer__header:hover {
    background: var(--theme-surface-3);
}

.course-spotlight-drawer__header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.course-spotlight-drawer__icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--spotlight-accent, #16a34a) 0%, var(--spotlight-accent-light, #22c55e) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.course-spotlight-drawer__title {
    margin: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-text-primary);
}

.course-spotlight-drawer__subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.course-spotlight-drawer__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--theme-border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--theme-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.course-spotlight-drawer__toggle:hover {
    background: var(--theme-surface-1);
    border-color: var(--spotlight-accent, #16a34a);
    color: var(--spotlight-accent, #16a34a);
}

.course-spotlight-drawer__toggle-icon {
    transition: transform 0.3s ease;
}

.course-spotlight-drawer.expanded .course-spotlight-drawer__toggle-icon {
    transform: rotate(180deg);
}

.course-spotlight-drawer__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-spotlight-drawer.expanded .course-spotlight-drawer__content {
    max-height: 1200px;
}

/* When inside drawer, container needs no outer styling */
.course-spotlight-drawer .course-spotlight-container {
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    margin: 0;
}

.course-spotlight-drawer .course-spotlight-container::before,
.course-spotlight-drawer .course-spotlight-container::after {
    display: none;
}

/* Dark mode drawer */
[data-bs-theme="dark"] .course-spotlight-drawer {
    background: var(--theme-surface-1);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .course-spotlight-drawer__header {
    background: var(--theme-surface-2);
}

[data-bs-theme="dark"] .course-spotlight-drawer__header:hover {
    background: var(--theme-surface-3);
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .course-spotlight-card {
        transition: box-shadow 0.2s ease;
    }

    .course-spotlight-card:hover {
        transform: none;
    }

    .course-spotlight-container .col-md-4:nth-child(2) .course-spotlight-card {
        transform: none;
    }

    .course-spotlight-drawer__content {
        transition: none;
    }

    .course-spotlight-drawer__toggle-icon {
        transition: none;
    }
}
