/* Courses Page Styles */

.courses-section {
    background: white;
    margin: 2rem auto;
    padding: 2rem 0;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    min-height: 70vh;
}

.page-header {
    text-align: center;
    padding: 0 20px;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin: 0;
}

.create-course-btn {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.create-course-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 90, 158, 0.4);
}

/* Filters */
.filters-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 0 20px 2rem 20px;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
}

.filter-group-compact {
    flex: 0 0 auto;
    min-width: 120px;
    max-width: 170px;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.filter-input,
.filter-select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #2B5A9E;
    box-shadow: 0 0 0 3px rgba(43, 90, 158, 0.1);
}

.clear-filters-btn {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: fit-content;
}

.clear-filters-btn:hover {
    border-color: #999;
    color: #333;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    padding: 0 20px;
}

/* Course Cards */
.course-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.course-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.course-header {
    margin-bottom: 0.75rem;
}

.course-name {
    color: #2B5A9E;
    font-size: 1.4rem;
    margin: 0 0 0.4rem 0;
}

.course-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.course-holes,
.course-location {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.course-country-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #2B5A9E;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 4px;
}

.course-description {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.view-layouts-btn {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.view-layouts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 90, 158, 0.4);
}

.arrow-down {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.view-layouts-btn.active .arrow-down {
    transform: rotate(180deg);
}

/* Layouts Container */
.layouts-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

/* Layout Cards */
.layout-card {
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.layout-card:last-child {
    margin-bottom: 0;
}

.layout-header {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    position: relative;
}

.layout-header:hover {
    background: #e9ecef;
}

.layout-header h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 0;
    flex: 1;
}

.layout-stats {
    display: flex;
    gap: 1rem;
    margin-right: 0.75rem;
}

.stat {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.toggle-icon {
    color: #2B5A9E;
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.layout-header.active .toggle-icon {
    transform: rotate(45deg);
}

/* Layout Details */
.layout-details {
    padding: 0 1rem 1rem 1rem;
    background: white;
}

/* Holes Table */
.holes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.holes-table thead {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
}

.holes-table th {
    padding: 0.6rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
}

.holes-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.holes-table tbody tr:hover {
    background: #f8f9fa;
}

.holes-table td {
    padding: 0.6rem;
    color: #333;
    font-size: 0.9rem;
}

.holes-table tbody tr:last-child {
    border-bottom: none;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-text {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.no-results-subtext {
    font-size: 0.95rem;
    color: #999;
}

/* Create Course Modal Styles */
#create-course-modal .modal-content {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    box-sizing: border-box;
}

#create-course-modal .modal-body {
    padding: 1.5rem;
}

#create-course-modal .form-group {
    margin-bottom: 1rem;
}

#create-course-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

#create-course-modal .form-group input,
#create-course-modal .form-group select,
#create-course-modal .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

#create-course-modal .form-group input:focus,
#create-course-modal .form-group select:focus,
#create-course-modal .form-group textarea:focus {
    outline: none;
    border-color: #2B5A9E;
}

#create-course-modal .secondary-btn {
    background: #f8f9fa;
    color: #2B5A9E;
    border: 2px solid #2B5A9E;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#create-course-modal .secondary-btn:hover {
    background: #2B5A9E;
    color: white;
}

#create-course-modal .cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
}

#create-course-modal .submit-btn {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
}

/* Hole input grid for create course */
#holes-input-container .manual-hole-row {
    display: grid;
    grid-template-columns: 80px 1fr 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

#holes-input-container .manual-hole-row .hole-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

#holes-input-container .manual-hole-row input,
#holes-input-container .manual-hole-row select {
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

#holes-input-container .manual-hole-row input:focus,
#holes-input-container .manual-hole-row select:focus {
    outline: none;
    border-color: #2B5A9E;
}

/* Responsive Design */
@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }

    .filters-container {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .clear-filters-btn {
        width: 100%;
    }

    .layout-stats {
        flex-direction: column;
        gap: 0.5rem;
        margin-right: 0.5rem;
    }

    .layout-header {
        flex-wrap: wrap;
    }

    .layout-header h3 {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .holes-table {
        font-size: 0.9rem;
    }

    .holes-table th,
    .holes-table td {
        padding: 0.5rem;
    }

    /* Create Course Modal Mobile */
    #create-course-modal .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }

    #create-course-modal .modal-body {
        padding: 1rem;
    }

    #holes-input-container .manual-hole-row {
        grid-template-columns: 60px 1fr 1fr;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .create-course-btn {
        width: 100%;
    }
}
