/* Global Styles - Custom Background Image Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    /* Replace the gradient with your image */
    background: url('../images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    /* Fallback color in case image doesn't load */
    background-color: #0f4c75;
    min-height: 100vh;
    color: #333;
}

/* Alternative: If you want a semi-transparent overlay over the image */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #001c89(15, 76, 117, 0.7); /* Blue overlay with opacity */
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.level-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.level-btn {
    background: #fff;
    color: #0f4c75;
    padding: 20px 40px;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.level-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    color: #0f4c75;
}

.login-header h2 {
    font-size: 2em;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    justify-content: flex-start;
}

.form-group label {
    width: 120px;
    font-weight: bold;
    color: #333;
}

.form-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.btn {
    background: #0f4c75;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn:hover {
    background: #1e5799;
}

/* Dashboard Styles */
.site-header {
    background: #ffffff;
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #001c89;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-bottom: 2px solid #e8ecf8;
    flex-wrap: wrap;
    gap: 15px;
}

/* Logo styling */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.9;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.logo-text {
    font-size: 1.3em;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo-text small {
    font-size: 0.7em;
    font-weight: normal;
    opacity: 0.8;
    display: block;
    line-height: 1.2;
}

/* Alternative text-only logo (if no image) */
.logo-text-only {
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

.logo-placeholder {
    font-size: 1.5em;
    font-weight: bold;
}

.logout-btn {
    background: #001c89;
    color: #ffffff;
    border: 1px solid #001c89;
    padding: 8px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #0028c8;
    color: #ffffff;
}

.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(5px);
    min-height: calc(100vh - 80px);
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.upload-section h2 {
    background: #001c89;
    color: white;
    padding: 20px 30px;
    margin: 0;
    font-size: 1.5em;
}

.lecturer-main {
    padding: 30px;
}

.upload-form-container {
    max-width: 700px;
    margin: 0 auto;
}

.form-row {
    margin-bottom: 25px;
}

.form-row label {
    display: block;
    font-weight: 600;
    color: #0f4c75;
    margin-bottom: 10px;
    font-size: 1rem;
}

.form-row select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.form-row select:focus {
    outline: none;
    border-color: #0f4c75;
}

.learning-material-group {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-top: 10px;
    border: 1px solid #e9ecef;
}

.learning-material-group label {
    display: block;
    color: #0f4c75;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.learning-material-group input[type="text"],
.learning-material-group textarea {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.learning-material-group input[type="text"]:focus,
.learning-material-group textarea:focus {
    outline: none;
    border-color: #0f4c75;
    box-shadow: 0 0 0 3px rgba(15,76,117,0.1);
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: inline-block;
    padding: 12px 20px;
    background: #e9ecef;
    color: #495057;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
    border: 2px dashed #adb5bd;
}

.file-label:hover {
    background: #dee2e6;
    border-color: #0f4c75;
}

.submit-btn {
    background: #001c89;
    padding: 14px 25px;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 10px;
    border-radius: 10px;
}

.submit-btn:hover {
    background: #1e5799;
    transform: translateY(-2px);
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Courses Section */
.courses-section {
    margin-top: 20px;
}

.courses-section h2 {
    color: #0f4c75;
    margin-bottom: 25px;
    font-size: 1.6em;
    padding-bottom: 10px;
    border-bottom: 3px solid #0f4c75;
    display: inline-block;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    padding: 10px 0;
}

.course-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.course-image {
    height: 100px;
    background: #001c89;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3em;
}

.course-card h3 {
    color: #001c89;
    margin: 20px 20px 10px;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.3;
}

.course-desc {
    padding: 0 20px 15px;
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
    flex: 1;
}

.progress-bar {
    background: #e9ecef;
    height: 6px;
    border-radius: 3px;
    margin: 0 20px 15px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    transition: width 0.5s;
}

.file-section {
    padding: 0 20px 20px;
    border-top: 1px solid #eee;
    margin-top: 5px;
}

.files-count {
    font-size: 0.8em;
    color: #6c757d;
    margin: 12px 0 10px;
    padding-top: 12px;
}

.file-list {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 8px;
}

.file-list li {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.file-list li:hover {
    background: #f8f9fa;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name a {
    color: #0f4c75;
    text-decoration: none;
    font-size: 0.85em;
}

.file-name a:hover {
    text-decoration: underline;
    color: #1e5799;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.empty-card {
    text-align: center;
    padding: 40px 20px;
}

.empty-card .course-image {
    background: #dee2e6;
    color: #6c757d;
}

.empty-card h3 {
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main {
        padding: 20px;
    }
    
    .course-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .level-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    body {
        padding: 0;
    }
    
    .site-header {
        padding: 12px 20px;
    }
    
    .logo img {
        height: 32px;
    }
    
    .logo-text {
        font-size: 1.1em;
    }
    
    .logo-text small {
        font-size: 0.65em;
    }
    
    .logo-placeholder {
        font-size: 1.2em;
    }
    
    .main {
        padding: 15px;
    }
    
    .upload-section h2 {
        padding: 15px 20px;
        font-size: 1.3em;
    }
    
    .lecturer-main {
        padding: 20px;
    }
    
    .learning-material-group {
        padding: 20px;
    }
    
    .course-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .course-card h3 {
        font-size: 1.2em;
        margin: 15px 15px 8px;
    }
    
    .course-desc {
        padding: 0 15px 12px;
    }
    
    .file-section {
        padding: 0 15px 15px;
    }
    
    .file-list li {
        flex-wrap: wrap;
    }
    
    .file-name {
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .site-header {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        justify-content: center;
    }
    
    .upload-form-container {
        width: 100%;
    }
    
    .form-row select,
    .learning-material-group input[type="text"],
    .learning-material-group textarea {
        font-size: 14px;
    }
    
    .btn {
        width: 100%;
    }
}