/* style.css */
:root {
    --mario-blue: #5C94FC;
    --mario-red: #E52521;
    --mario-gold: #FBD000;
    --lux-bg: linear-gradient(135deg, #5C94FC 0%, #1e5cb3 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
}

body {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    background: var(--lux-bg);
    color: white;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Headbar */
.mario-headbar {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--mario-gold);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hospital-logo {
    height: 50px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.portal-title {
    margin: 0;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Layout */
.main-container {
    display: flex;
    flex: 1;
}

/* Sidebar */
.mario-sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    border-right: 2px solid rgba(255,255,255,0.1);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 15px 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-nav li a:hover, .sidebar-nav li.active a {
    background: rgba(255,255,255,0.1);
    border-left: 4px solid var(--mario-gold);
    text-shadow: 0 0 10px var(--mario-gold);
}

/* Content Area & Grid */
.content-area {
    flex: 1;
    padding: 40px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* System Cards (หรูหราแบบ Mario) */
.system-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15), inset 0 0 0 2px transparent;
}

.system-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3), inset 0 0 0 2px var(--mario-gold);
    background: rgba(255, 255, 255, 0.25);
}

.card-icon {
    font-size: 60px;
    margin-bottom: 15px;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.4));
}

.system-card h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.system-card p {
    margin: 0;
    font-size: 14px;
    color: var(--mario-gold);
    font-weight: 600;
}

/* Footbar */
.mario-footbar {
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 15px;
    font-size: 14px;
}

/* เพิ่มลงในตอนท้ายของ style.css */

/* สำหรับ Tablet และหน้าจอที่เล็กกว่า 900px */
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
    }

    .mario-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid rgba(255,255,255,0.1);
        padding: 10px 0;
    }

    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .sidebar-nav li a {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 4px solid transparent;
    }

    .sidebar-nav li a:hover, .sidebar-nav li.active a {
        border-left: none;
        border-bottom: 4px solid var(--mario-gold);
    }

    .content-area {
        padding: 20px;
    }
}

/* สำหรับ Mobile (เล็กกว่า 600px) */
@media (max-width: 600px) {
    .mario-headbar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .icon-grid {
        grid-template-columns: 1fr; /* ให้การ์ดเรียงเป็นแถวเดียว */
    }
}