/* 
   common.css - Combined and optimized styles for EduContent LMS
   Created based on styles from index.html, login.html, manage.html, and upload.html
*/

:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6483f8;
    --dark-color: #2c3453;
    --light-color: #f5f8ff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 5px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: var(--shadow);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-actions i {
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.user-actions i:hover {
    color: var(--primary-color);
}

/* Main Container Layout */
.main-container {
    display: flex;
    flex: 1;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    height: calc(100vh - 58px);
    overflow-y: auto;
}

.sidebar-collapse-btn {
    display: none;
    margin: 10px;
    text-align: right;
}

.menu-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover, .menu-item.active {
    background-color: rgba(74, 108, 247, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

/* Content Area */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Breadcrumb Styles */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #ccc;
}

.current {
    color: var(--primary-color);
    font-weight: 500;
}

/* Panel Styles */
.panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dark-color);
}

.panel-body {
    padding: 20px;
}

/* Button Styles */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: #eee;
    color: #666;
}

.btn-secondary:hover {
    background-color: #ddd;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: rgba(74, 108, 247, 0.1);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: #f5f8ff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
    color: #555;
    border-bottom: 1px solid #eee;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: rgba(74, 108, 247, 0.05);
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.action-buttons .right-actions {
    display: flex;
    gap: 10px;
}

/* Tab Styles */
.tab-container {
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #eee;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    padding: 20px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-published {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-draft {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

/* Login Page Specific Styles */
.login-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: auto;
}

.login-hero {
    flex: 1;
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.feature-list {
    list-style: none;
}

.feature-item {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.feature-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.login-form-container {
    flex: 1;
    padding: 2rem;
}

.login-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    text-align: center;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.step {
    text-align: center;
    flex: 1;
    position: relative;
}

.step-number {
    width: 30px;
    height: 30px;
    background-color: #ddd;
    color: #777;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

.step-text {
    font-size: 0.8rem;
    color: #777;
}

.step.active .step-number {
    background-color: var(--primary-color);
    color: white;
}

.step.active .step-text {
    color: var(--primary-color);
    font-weight: bold;
}

.step.completed .step-number {
    background-color: var(--success-color);
    color: white;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ddd;
    z-index: 1;
}

/* File Upload Styles */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 5px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 15px;
}

.upload-text {
    margin-bottom: 10px;
    color: #777;
}

.upload-button {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--light-color);
    color: var(--primary-color);
    border-radius: 4px;
    font-weight: 500;
}

.upload-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #999;
}

.file-list {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 10px;
}

.file-icon {
    margin-right: 10px;
    color: var(--primary-color);
}

.file-name {
    flex: 1;
}

.file-size {
    color: #999;
    margin-right: 10px;
}

.file-remove {
    color: var(--danger-color);
    cursor: pointer;
}

/* Index Grid */
.index-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.index-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 300px;
    overflow: hidden;
}

.index-panel-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.index-panel-header .actions {
    display: flex;
    gap: 10px;
}

.index-panel-header .actions i {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.index-panel-header .actions i:hover {
    opacity: 1;
}

.index-list {
    padding: 0;
    margin: 0;
    list-style: none;
    max-height: 500px;
    overflow-y: auto;
}

.index-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.index-item:hover {
    background-color: rgba(74, 108, 247, 0.05);
}

.index-item.active {
    background-color: rgba(74, 108, 247, 0.1);
    border-left: 3px solid var(--primary-color);
}

.index-item-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.index-item-title i {
    color: var(--primary-color);
}

.page-count {
    background-color: #eee;
    color: #666;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Footer */
footer {
    padding: 10px 20px;
    background-color: #fff;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
    }

    .sidebar-collapse-btn {
        display: block;
    }
    
    .sidebar.collapsed {
        height: 50px;
        overflow: hidden;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .login-container {
        flex-direction: column;
        max-width: 500px;
    }
    
    .login-hero {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .index-container {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons .right-actions {
        justify-content: flex-end;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }
}