/* Course Manager Frontend Styles */

/* Course Cards */
.course-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.course-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-content {
    padding: 20px;
}

.course-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
}

.course-title a {
    color: #333;
    text-decoration: none;
}

.course-title a:hover {
    color: #0073aa;
}

.course-meta {
    margin-bottom: 15px;
}

.course-type,
.course-date {
    display: inline-block;
    background: #f1f1f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 5px;
}

.course-type.online {
    background: #e3f2fd;
    color: #1976d2;
}

.course-type.offline {
    background: #f3e5f5;
    color: #7b1fa2;
}

.course-type.hybrid {
    background: #e8f5e8;
    color: #388e3c;
}

.course-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.course-price .price {
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
}

.course-price .price.free {
    color: #28a745;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: #0073aa;
    color: white;
}

.btn-primary:hover {
    background: #005a87;
    color: white;
}

.register-button {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.register-button:hover {
    background: #218838;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.register-button.button-small {
    padding: 8px 16px;
    font-size: 14px;
}

.register-button.button-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Course Layouts */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.layout-grid.columns-1 .courses-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.layout-grid.columns-2 .courses-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.layout-grid.columns-3 .courses-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.layout-grid.columns-4 .courses-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.layout-list .course-card {
    display: flex;
    margin-bottom: 25px;
}

.layout-list .course-image {
    flex: 0 0 200px;
}

.layout-list .course-image img {
    height: 150px;
}

.layout-list .course-content {
    flex: 1;
}

/* Filters */
.course-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #333;
}

.filter-group select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Single Course */
.course-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.course-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
}

.course-header-content h1 {
    font-size: 36px;
    margin: 0 0 15px 0;
}

.course-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.course-main img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 30px;
}

.course-description {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
}

.course-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.course-info-box {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.price-section {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.course-price {
    font-size: 32px;
    font-weight: 700;
    color: #0073aa;
}

.course-price.free {
    color: #28a745;
}

.register-section {
    text-align: center;
    margin-bottom: 30px;
}

.register-section .register-button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
}

.course-details h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.course-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.course-details li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.course-details li:last-child {
    border-bottom: none;
}

.registration-closed,
.course-full {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

/* Archive Page */
.course-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.archive-header {
    background: #f8f9fa;
    padding: 40px 0;
    margin-bottom: 40px;
    text-align: center;
}

.archive-title {
    font-size: 32px;
    margin: 0 0 20px 0;
    color: #333;
}

.archive-filters {
    margin-top: 20px;
}

.course-filter-form {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.course-filter-form select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.filter-submit {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.filter-submit:hover {
    background: #005a87;
}

.no-courses {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Pagination */
.pagination-container {
    margin-top: 40px;
    text-align: center;
}

.page-numbers {
    display: inline-flex;
    gap: 5px;
}

.page-numbers a,
.page-numbers span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.page-numbers a:hover,
.page-numbers .current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Loading States */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .course-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .course-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .layout-list .course-card {
        flex-direction: column;
    }
    
    .layout-list .course-image {
        flex: none;
    }
    
    .course-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .course-filter-form {
        flex-direction: column;
    }
    
    .course-header h1 {
        font-size: 28px;
    }
    
    .course-single-container,
    .course-archive-container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .course-card {
        margin-bottom: 20px;
    }
    
    .course-content {
        padding: 15px;
    }
    
    .course-info-box {
        padding: 20px;
    }
    
    .course-price {
        font-size: 24px;
    }
}