/* ==========================================================================
   Courses Page Styles
   ========================================================================== */

/* ==========================================================================
   Hero Section
   ========================================================================== */
.courses-hero {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFB 100%);
    padding: 2.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.courses-hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-green) 0%, #10B981 100%);
}

.courses-hero__title {
    font-size: 2.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.courses-hero__subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

[data-theme="dark"] .courses-hero {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--secondary-bg) 100%);
}

/* ==========================================================================
   Hero Stats
   ========================================================================== */
.courses-hero__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.courses-hero__stat {
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.courses-hero__stat-value {
    font-size: 2.5rem;
    color: var(--accent-green);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.courses-hero__stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

[data-theme="dark"] .courses-hero__stat {
    background: var(--secondary-bg);
    border-color: var(--border-color);
}

/* ==========================================================================
   Filters Section
   ========================================================================== */
.courses-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.courses-filters__search {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.courses-filters__input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #D1D5DB;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.courses-filters__input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 103, 71, 0.1);
}

.courses-filters__btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-green) 0%, #10B981 100%);
    color: white;
    border: 2px solid var(--accent-green);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.courses-filters__btn:hover {
    background: linear-gradient(135deg, #047857 0%, var(--accent-green) 100%);
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.courses-filters__submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.courses-filters__submit-btn:hover {
    background: var(--secondary-bg);
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.1);
}

[data-theme="dark"] .courses-filters {
    background: var(--card-bg);
}

[data-theme="dark"] .courses-filters__input {
    background: var(--secondary-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .courses-filters__submit-btn {
    background: var(--secondary-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* ==========================================================================
   Filter Chips
   ========================================================================== */
.courses-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.courses-chip {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.courses-chip:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-1px);
}

.courses-chip--active {
    background: linear-gradient(135deg, var(--accent-green) 0%, #10B981 100%);
    color: white;
    border-color: var(--accent-green);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

[data-theme="dark"] .courses-chip {
    background: var(--secondary-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* ==========================================================================
   Search Dropdown
   ========================================================================== */
.courses-search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-loading,
.search-error {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.search-error {
    color: #dc2626;
}

.search-empty {
    padding: 2rem;
    text-align: center;
}

.search-empty p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.search-submit-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #f59e0b;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-submit-btn:hover {
    background: #d97706;
}

.search-section-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-section-header--local {
    background: #f0fdf4;
    color: #166534;
    border-bottom: 1px solid #bbf7d0;
}

.search-section-header--api {
    background: #eff6ff;
    color: #1e40af;
    border-bottom: 1px solid #bfdbfe;
}

.search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.search-result--local:hover {
    background: #f9fafb;
}

.search-result--api:hover {
    background: #eff6ff;
}

.search-result__info {
    flex: 1;
    min-width: 0;
}

.search-result__name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result__location {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

.search-result__tees {
    padding: 0.25rem 0.5rem;
    background: #dcfce7;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.search-result__tees--api {
    background: #dbeafe;
    color: #1e40af;
}

.search-result__status {
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
}

.search-result__import-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-green);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result__import-btn:hover {
    background: #047857;
}

.search-result__imported-btn {
    padding: 0.5rem 1rem;
    background: #9ca3af;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: not-allowed;
}

.search-footer {
    padding: 0.75rem 1rem;
    background: #fefce8;
    border-top: 2px solid #fcd34d;
    text-align: center;
}

.search-submit-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f59e0b;
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-submit-link:hover {
    background: #d97706;
}

[data-theme="dark"] .courses-search-dropdown {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .search-section-header--local {
    background: #064e3b;
    color: #86efac;
    border-color: #065f46;
}

[data-theme="dark"] .search-section-header--api {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #1e40af;
}

[data-theme="dark"] .search-result--local:hover,
[data-theme="dark"] .search-result--api:hover {
    background: var(--secondary-bg);
}

[data-theme="dark"] .search-result__tees {
    background: #065f46;
    color: #86efac;
}

[data-theme="dark"] .search-result__tees--api {
    background: #1e3a5f;
    color: #93c5fd;
}

[data-theme="dark"] .search-result__status {
    background: var(--secondary-bg);
    color: var(--text-secondary);
}

[data-theme="dark"] .search-footer {
    background: #292524;
    border-color: #a16207;
}

/* ==========================================================================
   Section Container
   ========================================================================== */
.courses-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.courses-section__title {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .courses-section {
    background: var(--card-bg);
}

/* ==========================================================================
   Map Container
   ========================================================================== */
.courses-map {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.courses-map__legend {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

/* ==========================================================================
   Course Grid
   ========================================================================== */
.courses-grid {
    display: grid;
    gap: 1rem;
}

/* ==========================================================================
   Course Card
   ========================================================================== */
.course-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.course-card--played {
    border-left-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.04) 0%, white 100%);
}

.course-card--favorite {
    border-left-color: var(--accent-gold);
    background: linear-gradient(135deg, rgba(197, 165, 114, 0.04) 0%, white 100%);
}

.course-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.12);
    border-color: var(--accent-green);
}

[data-theme="dark"] .course-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .course-card--played {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.1) 0%, var(--card-bg) 100%);
}

[data-theme="dark"] .course-card--favorite {
    background: linear-gradient(135deg, rgba(197, 165, 114, 0.1) 0%, var(--card-bg) 100%);
}

/* ==========================================================================
   Course Badge
   ========================================================================== */
.course-card__badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
}

.course-card__badge--played {
    background: linear-gradient(135deg, var(--accent-green) 0%, #10B981 100%);
    color: white;
    border-color: var(--accent-green);
}

.course-card__badge--favorite {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4b896 100%);
    color: white;
    border-color: var(--accent-gold);
}

[data-theme="dark"] .course-card__badge {
    background: var(--secondary-bg);
    border-color: var(--border-color);
}

/* ==========================================================================
   Course Info
   ========================================================================== */
.course-card__name {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.course-card__location {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.course-card__stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.course-card__stats strong {
    color: var(--accent-green);
    font-weight: 600;
}

/* ==========================================================================
   Course Actions
   ========================================================================== */
.course-card__actions {
    text-align: right;
}

.course-card__action-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent-green) 0%, #10B981 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.25s ease;
    display: inline-block;
    margin-bottom: 0.5rem;
    border: 2px solid var(--accent-green);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.course-card__action-btn:hover {
    background: linear-gradient(135deg, #047857 0%, var(--accent-green) 100%);
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.course-card__user-stat {
    display: block;
    font-size: 0.8125rem;
    color: var(--accent-gold);
    font-weight: 600;
}

/* ==========================================================================
   Favorite Button
   ========================================================================== */
.course-card__favorite {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    transition: all 0.2s ease;
    line-height: 1;
}

.course-card__favorite:hover {
    transform: scale(1.2);
}

.course-card__favorite--active {
    color: #ef4444;
}

.course-card__favorite--inactive {
    color: #d1d5db;
}

.course-card__favorite--inactive:hover {
    color: #f87171;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.courses-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.courses-empty__icon {
    font-size: 4rem;
    color: var(--border-subtle);
    margin-bottom: 1rem;
}

/* ==========================================================================
   Activity Item
   ========================================================================== */
.courses-activity {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.courses-activity--good {
    border-left-color: var(--accent-green);
}

/* ==========================================================================
   Charts
   ========================================================================== */
.courses-chart {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.courses-chart__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

[data-theme="dark"] .courses-chart,
[data-theme="dark"] .courses-activity {
    background: var(--secondary-bg);
}

/* ==========================================================================
   Location Card
   ========================================================================== */
.courses-location {
    padding: 1rem;
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.courses-location__name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.courses-location__count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

[data-theme="dark"] .courses-location {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .courses-hero {
        padding: 1.5rem;
    }

    .courses-hero__title {
        font-size: 1.5rem;
    }

    .courses-hero__subtitle {
        font-size: 0.9rem;
    }

    .courses-hero__stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .courses-hero__stat {
        padding: 1rem;
    }

    .courses-hero__stat-value {
        font-size: 1.75rem;
    }

    .courses-filters {
        padding: 1rem;
    }

    .courses-filters__input {
        font-size: 14px;
    }

    .courses-chips {
        flex-wrap: wrap;
    }

    .courses-chip {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .course-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem;
    }

    .courses-map {
        height: 250px;
    }

    .courses-section__title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .courses-hero__stats {
        grid-template-columns: 1fr;
    }

    .courses-hero__stat-value {
        font-size: 1.5rem;
    }
}
