/* Main LMS Styles */
:root {
    --primary-color: #3a65ed;
    --secondary-color: #2c5fd1;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #333;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 20px 0;
}

/* Enhanced Cards */
.lms-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    overflow: hidden;
}

.lms-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.lms-card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 20px;
    font-weight: 600;
}

.lms-card-body {
    padding: 20px;
}

/* Enhanced Buttons */
.btn-lms-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-lms-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 101, 237, 0.3);
}

/* Footer Mobile Fix */
.u-footer {
    background-color: #4d4d4d;
    padding: 20px 0;
}

.u-footer .u-text {
    font-size: 14px !important;
    line-height: 1.5;
    color: #ffffff;
}

.u-footer .u-small-text {
    font-size: 12px !important;
    line-height: 1.4;
}

/* Mobile-specific footer fixes */
@media (max-width: 768px) {
    .u-footer .u-text {
        font-size: 13px !important;
    }
    
    .u-footer .u-small-text {
        font-size: 11px !important;
    }
    
    .u-footer .u-text-1 {
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .u-footer .u-text {
        font-size: 12px !important;
    }
    
    .u-footer .u-small-text {
        font-size: 10px !important;
    }
    
    .u-footer .u-text-1 {
        font-size: 12px !important;
    }
}

/* Course Grid Styles */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.course-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.course-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.course-content {
    padding: 20px;
}

.course-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.course-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: #999;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Dashboard Widget Styles */
.dashboard-widget {
    background: #fff;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.dashboard-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.widget-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.dashboard-widget h4 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.dashboard-widget p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Alert Styles */
.alert-lms {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
    margin: 15px 0;
}

.alert-lms-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}

.alert-lms-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

.alert-lms-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
}

/* Form Enhancements */
.form-lms {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.form-lms .form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.form-lms .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(58, 101, 237, 0.25);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Progress Bars */
.progress-lms {
    height: 10px;
    border-radius: 10px;
    background: #e9ecef;
    overflow: hidden;
}

.progress-bar-lms {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Video Player Enhancements */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 15px;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

/* Module List */
.module-list {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.module-item {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.3s ease;
}

.module-item:hover {
    background: #f8f9fa;
}

.module-item:last-child {
    border-bottom: none;
}

.module-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.module-duration {
    color: #666;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .course-grid {
        grid-template-columns: 1fr;
    }
    
    .form-lms {
        margin: 0 15px;
        padding: 20px;
    }
    
    .dashboard-widget {
        margin-bottom: 20px;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Certificate Preview Styles */
.certificate-container {
    transform-origin: center;
    transition: transform 0.3s ease;
    /* Scale down for inline preview */
    transform: scale(0.6);
    margin: -80px auto;
}

.certificate-container:hover {
    transform: scale(0.62);
}

/* Full size when in modal or standalone */
.modal .certificate-container,
.certificate-fullsize .certificate-container {
    transform: scale(1) !important;
    margin: 0 auto !important;
}

.modal .certificate-container:hover {
    transform: scale(1.02) !important;
}

@media (max-width: 1200px) {
    .certificate-container {
        transform: scale(0.5);
        margin: -100px auto;
    }
    
    .certificate-container:hover {
        transform: scale(0.52);
    }
}

@media (max-width: 768px) {
    .certificate-container {
        width: 100% !important;
        height: auto !important;
        padding: 20px !important;
        font-size: 14px !important;
        transform: scale(1) !important;
        margin: 0 auto !important;
    }
    
    .certificate-container:hover {
        transform: scale(1) !important;
    }
    
    .certificate-container h1 {
        font-size: 24px !important;
    }
    
    .certificate-container .student-name {
        font-size: 20px !important;
    }
}

.modal-xl .modal-dialog {
    max-width: 1200px;
}

#certificatePreviewModal .modal-body {
    padding: 2rem;
}

#certificatePreviewContent {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow-x: auto;
}

#certificatePreviewContainer {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.certificate-decorative-corner {
    position: absolute;
    width: 60px;
    height: 60px;
}

.certificate-decorative-line {
    width: 200px;
    height: 3px;
    margin: 20px auto;
}

.certificate-footer-info {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    width: 600px;
    font-size: 12px;
    color: #7f8c8d;
}

@media (max-width: 900px) {
    .certificate-footer-info {
        width: 90%;
        font-size: 10px;
    }
    
    .certificate-decorative-corner {
        width: 40px;
        height: 40px;
    }
}
