/* =========================================
   GLOBAL.CSS - SmartUniMart Master Styles
   ========================================= */

/* 1. CSS VARIABLES */
:root {
    --charcoal-black: #1a1a1a;   
    --canvas-white: #ffffff;    
    --soft-gray-bg: #f4f6f8;    
    
    --theme-color: #27ae60;
    --action-color: #f39c12;
    
    --student-green: #27ae60;
    --parent-gold: #f1c40f;
    --teacher-blue: #3498db;
    --login-dark-green: #1b5e20;
    
    /* Spacing Standards */
    --radius-sm: 6px;
    --radius-md: 12px;

    --cart-accent: #f39c12; 
    --cart-accent-hover: #e67e22;
}

body:has(.parent-mode) {
    --theme-color: #f1c40f !important; 
    --action-color: #1a1a1a !important;
}

/* 2. UNIVERSAL RESET */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

/* 3. SCROLLBARS */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* 4. LAYOUT FUNDAMENTALS */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--soft-gray-bg);
}

/* Header */
header {
    background-color: var(--charcoal-black) !important;
    border-bottom: 1px solid #333 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
}

.header {
    height: 90px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1, .header-text h1 {
    color: var(--canvas-white) !important;
    font-size: 1.6rem;
    font-weight: bold;
    text-transform: uppercase;
}

.logo {
    height: 60px;
    width: 60px;
    background: white; 
    border-radius: 50%;
    padding: 2px;
    border: 2px solid var(--theme-color); 
}

/* Wrapper & Nav */
.wrapper {
    display: flex;
    flex: 1;
    background-color: var(--charcoal-black); 
    overflow: hidden;
}

nav {
    background-color: var(--charcoal-black) !important;
    border-top: solid var(--theme-color);
    border-left: solid var(--theme-color);
    border-bottom: solid var(--theme-color);
    width: 250px !important;
    padding: 20px 15px !important;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

nav ul { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    list-style: none; 
}

nav ul li a {
    display: block;
    color: #cccccc !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 12px 20px !important;
    border-radius: 6px !important;
    text-decoration: none;
    border: 1px solid transparent !important;
    transition: all 0.2s ease;
}

nav ul li a:hover {
    background-color: #333333 !important; 
    color: #ffffff !important;
    border-left: 4px solid var(--theme-color) !important;
}

nav ul li a.active {
    background-color: var(--theme-color) !important;
    color: #ffffff !important;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
    border: none !important;
}

main {
    background-color: var(--canvas-white) !important;
    padding: 30px !important;
    border: solid var(--theme-color) !important;
    flex: 1;
    overflow-y: auto;
}

/* 5. STANDARDIZED COMPONENTS */
.content-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    margin-bottom: 20px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-sm);
}

.standard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.standard-table th {
    background: var(--charcoal-black);
    color: white;
    padding: 15px;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 3px solid var(--theme-color);
}

.standard-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #333;
    vertical-align: middle;
}

.standard-table tr:hover { background-color: #f9f9f9; }

/* 6. MODALS */
.modal-overlay {
    display: none; 
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: white;
    width: 90%;
    max-width: 450px;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg {
    max-width: 750px !important;
}

/* 7. TOAST NOTIFICATIONS */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    color: var(--charcoal-black);
    min-width: 250px;
    max-width: 350px;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    animation: slideInRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    pointer-events: auto;
    border-left: 5px solid transparent;
}

.toast-success { border-left-color: #27ae60; }
.toast-error { border-left-color: #e74c3c; }
.toast-info { border-left-color: #3498db; }
.toast-warning { border-left-color: #f39c12; }

.toast.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    to { transform: translateX(0); }
}

@keyframes slideOutRight {
    to { transform: translateX(120%); opacity: 0; }
}

/* 8. MOBILE RESPONSIVENESS */
.menu-toggle { display: none; }
.menu-overlay { display: none; }

@media (max-width: 768px) {
    html, body { height: 100%; min-height: 100vh; overflow-x: hidden; }
    .wrapper { display: flex; flex-direction: column; min-height: 100vh; }
    
    .header { padding: 0 15px; height: 60px; z-index: 1001; }
    .header h1 { font-size: 1.1rem; margin-left: 45px; margin-top: 15px; }
    .logo { width: 35px; height: 35px; margin-top: 10px; }
    
    .menu-toggle { display: block !important; position: absolute; left: 15px; top: 18px; font-size: 24px; color: white; background: none; border: none; cursor: pointer; z-index: 1002; }
    
    nav { position: fixed; top: 0; left: -260px; width: 250px; height: 100vh; z-index: 1100; transition: left 0.3s ease-in-out; padding-top: 70px; border: none !important; }
    nav.active { left: 0; }
    
    .menu-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1050; backdrop-filter: blur(2px); }
    .menu-overlay.active { display: block; }
    
    main { flex: 1; padding: 15px !important; border-top: 5px solid var(--theme-color) !important; min-height: auto; }
    .content-card { padding: 15px; width: 100%; }

    .modal-box { width: 95%; padding: 20px; margin: auto; }
    
    .split-row { display: flex; flex-direction: column !important; gap: 10px; margin: 15px 0; }
    .info-box span { display: block; font-size: 0.75rem; color: #888; margin-bottom: 4px; text-transform: uppercase; }
    .info-box strong { display: block; font-size: 1.1rem; color: #333; font-weight: bold; }

    #toast-container { top: 10px; right: 10px; left: 10px; align-items: center; }
    .toast { width: 100%; max-width: 100%; }
}