/* assets/css/style.css */
/* 
 * Premium SAAS Styling for School Onboarding
 * Colors based on prompt: Blue (Primary), Gray (Secondary), Green (Success), Red (Danger)
 */

:root {
    /* Color Palette */
    --primary-color: #2563EB; /* Premium Blue */
    --primary-dark: #1E40AF;
    --primary-light: #eff6ff;
    
    --secondary-color: #64748B; /* Professional Gray */
    --text-main: #1e293b;
    --text-muted: #94a3b8;
    
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --border-color: #e2e8f0;
    
    /* Layout Variables */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    
    /* Box Shadows (Premium feel) */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
    
    /* Transitions */
    --transition-speed: 0.3s;
    --border-radius: 12px; /* Smooth rounded corners */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; background: transparent; }

/* 
 * Layout Wrappers
 */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.public-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
}

/* 
 * Sidebar 
 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    height: 100vh;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) ease;
    z-index: 100;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i { font-size: 1.5rem; }

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-category {
    display: none;
}

.sidebar-nav {
    padding: 20px 10px;
    overflow-y: auto;
    flex-grow: 1;
}

.nav-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin: 15px 0 5px 15px;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    color: var(--secondary-color);
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

/* Sidebar Toggle for Mobile */
#sidebar-close { display: none; }

/* 
 * Main Content Area
 */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    width: calc(100% - var(--sidebar-width));
    transition: width var(--transition-speed) ease;
}

.sidebar.collapsed ~ .main-content {
    width: calc(100% - var(--sidebar-collapsed-width));
}

.top-nav {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.toggle-btn {
    font-size: 1.5rem;
    color: var(--secondary-color);
    padding: 5px;
    border-radius: 5px;
}
.toggle-btn:hover { background-color: var(--bg-body); color: var(--primary-color); }

.notification-bell {
    position: relative;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
}

.notification-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-profile:hover {
    background-color: var(--bg-body);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name { font-weight: 600; font-size: 0.9rem; }
.user-role { font-size: 0.8rem; color: var(--text-muted); }

.page-container {
    padding: 30px;
    flex-grow: 1;
}

/* 
 * Utility Classes (Premium Cards & Forms)
 */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: #fafafa;
}

.form-control:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-danger { background-color: var(--danger-color); color: white; }
.btn-success { background-color: var(--success-color); color: white; }

.btn-block { width: 100%; padding: 12px; }

/* Dashboard Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* Auth Cards */
.auth-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-header {
    margin-bottom: 30px;
}
.auth-header i { font-size: 3rem; color: var(--primary-color); margin-bottom: 10px;}
.auth-header h1 { font-size: 1.8rem; margin-bottom: 5px;}
.auth-header p { color: var(--text-muted); }

/* Toasts */
.toast {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}
.toast-success { background-color: #d1fae5; color: #065f46; border-left: 4px solid var(--success-color); }
.toast-error { background-color: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger-color); }

/* Data Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { font-weight: 600; color: var(--secondary-color); background-color: #f8fafc; }
.table tr:hover td { background-color: #f1f5f9; }

/* Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-paid, .status-active { background-color: #d1fae5; color: #065f46; }
.status-unpaid, .status-inactive { background-color: #fee2e2; color: #991b1b; }
.status-pending { background-color: #fef3c7; color: #92400e; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
    }
    .sidebar.mobile-open {
        left: 0;
        width: 280px;
        box-shadow: var(--shadow-lg);
    }
    .main-content {
        width: 100%;
    }
    .sidebar.collapsed ~ .main-content {
        width: 100%;
    }
    #sidebar-close {
        display: block;
    }
    .md-hidden { display: none; }
}
