/* CUHK Law E-Mentoring Platform - Main Stylesheet */

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

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

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

/* Header Styles */
header { 
    background: #2c3e50; 
    color: white; 
    padding: 1rem 0; 
}

header .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap;
}

header h1 { 
    font-size: 1.5rem; 
}

header h1, header h1 a { 
    color: white; 
    text-decoration: none;
}

nav a { 
    color: white; 
    text-decoration: none; 
    margin-left: 20px; 
}

nav a:hover { 
    text-decoration: underline; 
}

/* Button Styles */
.btn { 
    display: inline-block; 
    padding: 10px 20px; 
    font-size: 1rem;
    background: #3498db; 
    color: white; 
    text-decoration: none; 
    border-radius: 4px; 
    border: none; 
    cursor: pointer;
    text-align: center;
}

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

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

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

.btn-danger { 
    background: #e74c3c; 
}

.btn-danger:hover { 
    background: #c0392b; 
}

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

.btn-success:hover { 
    background: #229954; 
}

/* Card Styles */
.card { 
    background: white; 
    padding: 20px; 
    margin: 20px 0; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

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

.form-group label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
}

.form-group input, 
.form-group select, 
.form-group textarea { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
}

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

.required {
    color: red;
}

.info-text {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* Alert Styles */
.alert { 
    padding: 15px; 
    margin: 15px 0; 
    border-radius: 4px; 
}

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

.alert-error { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb; 
}

.alert-info { 
    background: #d1ecf1; 
    color: #0c5460; 
    border: 1px solid #bee5eb; 
}

/* Table Styles */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin: 20px 0; 
}

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

table th { 
    background: #f8f9fa; 
    font-weight: bold; 
}

table tr:hover { 
    background: #f8f9fa; 
}

/* Badge Styles */
.badge { 
    display: inline-block; 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 0.85rem; 
}

.badge-success { 
    background: #d4edda; 
    color: #155724; 
}

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

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

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

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.dashboard-card h3 {
    margin: 10px 0;
    color: #333;
}

.dashboard-card .count {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    /* Header responsive */
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav {
        width: 100%;
        margin-top: 10px;
    }
    
    nav a {
        display: inline-block;
        margin: 5px 10px 5px 0;
    }
    
    /* Hide tables on mobile, show accordion instead */
    table.responsive-table {
        display: none;
    }
    
    /* Accordion styles for mobile */
    .mobile-accordion {
        display: block;
    }
    
    .accordion-item {
        background: white;
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 10px;
        overflow: hidden;
    }
    
    .accordion-header {
        background: #f8f9fa;
        padding: 15px;
        cursor: pointer;
        font-weight: bold;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .accordion-header:hover {
        background: #e9ecef;
    }
    
    .accordion-body {
        padding: 15px;
        display: none;
    }
    
    .accordion-body.active {
        display: block;
    }
    
    .accordion-row {
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }
    
    .accordion-row:last-child {
        border-bottom: none;
    }
    
    .accordion-label {
        font-weight: bold;
        color: #666;
        font-size: 0.9rem;
        display: block;
        margin-bottom: 4px;
    }
    
    .accordion-value {
        display: block;
    }
    
    /* Form adjustments */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
    
    /* Card adjustments */
    .card {
        padding: 15px;
        margin: 10px 0;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    /* Dashboard cards responsive */
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

@media screen and (min-width: 769px) {
    /* Hide mobile accordion on desktop */
    .mobile-accordion {
        display: none;
    }
    
    /* Show table on desktop */
    table.responsive-table {
        display: table;
    }
}
