/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* App Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar.collapsed .sidebar-header h2 span {
    display: none;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: white;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
    font-weight: 600;
}

.menu-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .menu-item span {
    display: none;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.user-info i {
    font-size: 32px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar.collapsed .user-details {
    display: none;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .btn-logout span {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-collapsed .main-content {
    margin-left: 80px;
}

/* Top Header */
.top-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    color: #667eea;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-toggle-sidebar:hover {
    background: #f0f4ff;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-date,
.header-time {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

.header-date i,
.header-time i {
    color: #667eea;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 30px;
}

/* Footer */
.footer {
    background: white;
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: #667eea;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-icon {
    font-size: 40px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.stat-details {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #d68910;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-info {
    background: #3498db;
    color: white;
}

.btn-info:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table thead {
    background: #f8f9fa;
}

table th,
table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    transition: all 0.3s ease;
}

table tbody tr:hover {
    background: #f8f9fa;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-progress,
.badge-in-progress {
    background: #cfe2ff;
    color: #084298;
}

.badge-completed {
    background: #d1e7dd;
    color: #0a3622;
}

.badge-high {
    background: #f8d7da;
    color: #721c24;
}

.badge-medium {
    background: #fff3cd;
    color: #856404;
}

.badge-low {
    background: #d1ecf1;
    color: #0c5460;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d1e7dd;
    color: #0a3622;
    border-left: 4px solid #198754;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: #cfe2ff;
    color: #084298;
    border-left: 4px solid #0d6efd;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.module-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.module-card h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.module-card p {
    opacity: 0.9;
    font-size: 14px;
}

/* Reminder Options */
.reminder-options {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.reminder-checkbox {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reminder-checkbox:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateX(5px);
}

.reminder-checkbox.checked {
    border-color: #667eea;
    background: #f0f4ff;
}

.reminder-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #667eea;
}

.reminder-checkbox-content {
    flex: 1;
}

.reminder-checkbox-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 3px;
}

.reminder-checkbox-desc {
    font-size: 12px;
    color: #666;
}

.reminder-icon {
    font-size: 24px;
    margin-right: 15px;
}

/* Result Box */
.result-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.result-box h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.result-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.2em;
    color: #667eea;
    padding-top: 15px;
    margin-top: 5px;
    border-top: 2px solid #667eea;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
    font-size: 28px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-collapsed .main-content {
        margin-left: 0;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .header-date span,
    .header-time span {
        display: none;
    }
    
    .header-date,
    .header-time {
        padding: 8px;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .page-content {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Compact stat cards for mobile */
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    
    .stat-icon {
        font-size: 24px;
        width: 45px;
        height: 45px;
    }
    
    .stat-label {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        font-size: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    /* Table Responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    table th,
    table td {
        padding: 10px;
        font-size: 13px;
    }
    
    /* Form adjustments */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevent zoom on iOS */
        width: 100%;
    }
    
    /* Responsive form grid */
    form > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .reminder-checkbox {
        padding: 12px;
    }
    
    .reminder-icon {
        font-size: 20px;
        margin-right: 10px;
    }
    
    .reminder-checkbox-title {
        font-size: 14px;
    }
    
    .reminder-checkbox-desc {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 12px 15px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .btn-toggle-sidebar {
        padding: 6px 10px;
        font-size: 18px;
    }
    
    .header-date,
    .header-time {
        display: none;
    }
    
    .page-content {
        padding: 10px;
    }
    
    .card {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .stats-grid {
        gap: 10px;
    }
    
    .stat-card {
        padding: 10px;
        gap: 8px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .module-card {
        padding: 20px;
    }
    
    .module-card h3 {
        font-size: 18px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 16px;
    }
    
    .alert {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .result-item {
        font-size: 13px;
        flex-wrap: wrap;
    }
    
    .result-item span:last-child {
        margin-top: 5px;
        width: 100%;
        text-align: right;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px 5px;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .table-actions form,
    .table-actions .btn {
        width: 100%;
    }
    
    .login-card {
        padding: 25px;
    }
    
    .login-card h2 {
        font-size: 22px;
    }
}

/* Mobile Sidebar Overlay */
@media (max-width: 768px) {
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .sidebar {
        z-index: 1000;
    }
}
