:root {
    --primary-color: #1967d2; /* Primary Blue */
    --text-color: #3c4043;
    --bg-color: #ffffff;
    --card-hover: #f1f3f4;
    --drawer-width: 300px;
    --header-height: 64px;
}

body {
    font-family: 'Sarabun', 'Roboto', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    overflow-x: hidden;
}

/* Header */
.gc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: white;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    color: #5f6368;
    margin-right: 15px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background-color: rgba(60, 64, 67, 0.08);
}

/* Logout Link Styles */
.logout-link {
    color: #d93025;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.logout-link:hover {
    background-color: rgba(217, 48, 37, 0.04);
}

.logout-icon {
    display: none;
}

.gc-logo {
    display: flex;
    align-items: center;
    font-size: 1.375rem;
    color: #5f6368;
    text-decoration: none;
    white-space: nowrap;
}

.gc-logo span {
    margin-left: 8px;
    font-weight: 500;
}

.gc-logo .highlight {
    color: #1967d2; /* Primary Blue */
}

/* Sidebar Drawer - Always Open */
.gc-drawer {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--drawer-width);
    background-color: white;
    border-right: 1px solid #e0e0e0;
    transform: none;
    transition: none;
    z-index: 999;
    overflow-y: auto;
    padding-top: 10px;
    padding-bottom: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 48px;
    color: #3c4043;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0 24px 24px 0;
    margin-right: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background-color: #f1f3f4;
}

.nav-item.active {
    background-color: #e8f0fe; /* Light blue */
    color: #1967d2;
}

.nav-item.active i {
    color: #1967d2;
}

.nav-item i {
    margin-right: 20px;
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    color: #5f6368;
}

.nav-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 8px 0;
}

.nav-subtitle {
    padding: 16px 24px 12px;
    font-size: 0.75rem;
    color: #5f6368;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.gc-drawer.open {
    /* transform: translateX(0); */
}

.drawer-overlay {
    display: none !important; /* Hide overlay */
}

.menu-btn {
    display: none; /* Hide toggle button */
}

/* Main Content - Shifted right */
.gc-main {
    margin-top: var(--header-height);
    margin-left: var(--drawer-width); /* Add margin for sidebar */
    padding: 24px;
    max-width: 1000px; /* Adjust max width */
    box-sizing: border-box;
    width: auto;
}

.class-grid {
    display: flex;
    flex-wrap: wrap; /* Grid like layout */
    gap: 24px;
    width: 100%;
}

/* Card Style - Box View */
.gc-card {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Vertical stack */
    height: 300px; /* SRIWORAKARN COLLEGE Card Height */
    width: 100%;
    max-width: 320px;
    transition: box-shadow 0.2s;
    position: relative;
    box-sizing: border-box;
    flex-grow: 1; /* Allow growing */
}

/* Responsive Grid */
@media (min-width: 600px) {
    .gc-card {
        width: 48%; /* 2 per row */
        max-width: none;
    }
}

@media (min-width: 960px) {
    .gc-card {
        width: 31%; /* 3 per row */
        max-width: none;
    }
}


.gc-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-header-top {
    height: 100px;
    padding: 16px;
    color: white;
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.card-bg-1 { background-color: #1e8e3e; background-image: url('https://gstatic.com/classroom/themes/img_code.jpg'); } 
.card-bg-2 { background-color: #d93025; background-image: url('https://gstatic.com/classroom/themes/img_read.jpg'); }
.card-bg-3 { background-color: #f9ab00; background-image: url('https://gstatic.com/classroom/themes/img_breakfast.jpg'); }
.card-bg-4 { background-color: #1a73e8; background-image: url('https://gstatic.com/classroom/themes/img_graduation.jpg'); }

.card-header-content {
    z-index: 2;
}

.card-title {
    font-size: 1.375rem;
    font-weight: 500;
    color: white;
    text-decoration: none;
    margin: 0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px; /* Adjusted matches card width increase */
}

.card-title:hover {
    text-decoration: underline;
}

.card-subtitle {
    font-size: 0.875rem;
    margin-top: 4px;
    color: white;
    display: block;
}

.teacher-name {
    margin-top: auto;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.9);
    position: absolute;
    bottom: 12px;
}

.card-menu-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column; /* Stack details vertically */
    align-items: flex-start; /* Align left */
    justify-content: center; /* Center vertically in the space */
    position: relative;
    gap: 8px; /* Spacing between elements */
}

.attendance-stat {
    font-size: 2.5rem;
    color: #3c4043;
    font-weight: 400;
}

.attendance-label {
    font-size: 0.8rem;
    color: #5f6368;
    margin-left: 8px;
}

.card-footer {
    padding: 8px 16px;
    border-top: 1px solid #dadce0;
    display: flex;
    flex-direction: row;
    justify-content: flex-end; /* Icons on right */
    align-items: center;
    height: 48px;
    background: white;
}

/* Response */
@media (max-width: 900px) {
    .gc-drawer {
        width: 70px;
        position: fixed;
        z-index: 1000;
        transition: width 0.3s ease;
        overflow: hidden;
    }
    
    /* When collapsed, hide text labels, keep icons centered */
    .gc-drawer .nav-item {
        padding: 0;
        justify-content: center;
        width: 100%;
        margin-right: 0;
        border-radius: 50%;
        height: 48px;
        margin: 4px auto;
    }
    
    .gc-drawer .nav-item i {
        margin-right: 0;
        font-size: 1.5rem;
    }
    
    .gc-drawer .nav-subtitle, 
    .gc-drawer .nav-item span {
        display: none;
    }
    
    .gc-drawer .nav-item {
        font-size: 0; /* Hide text */
    }
    .gc-drawer .nav-item i {
        font-size: 1.25rem; /* Restore icon size */
    }

    .gc-main {
        margin-left: 70px; /* Match collapsed width */
        width: calc(100% - 70px);
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .gc-header {
        padding: 0 12px;
        height: 56px; /* Slightly smaller header on mobile */
    }
    
    /* Adjust Logo Size for Mobile */
    .gc-logo {
        font-size: 1.1rem; /* Smaller font size */
    }
    
    .gc-logo span {
        margin-left: 4px; /* Tighter spacing */
    }
    
    .menu-btn {
        margin-right: 4px; /* Closer to edge */
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    /* Adjust main content top margin to match new header height */
    .gc-main {
        margin-top: 56px; 
    }
    
    .gc-drawer {
        top: 56px; /* Connect to new header height */
        display: none; /* Hide default sidebar */
        /* If we want a mobile drawer, we need JS toggle class 'open' */
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    /* Change Logout to Icon on Mobile */
    .logout-text {
        display: none;
    }
    .logout-icon {
        display: block;
        font-size: 1.25rem;
    }

    .gc-drawer.open {
        display: block;
        transform: translateX(0);
    }

    .gc-drawer .nav-item {
        font-size: 0.875rem; /* Restore text size */
        justify-content: flex-start;
        padding: 0 24px; /* text is visible */
        width: auto;
        border-radius: 0 24px 24px 0;
        margin: 4px 8px 4px 0;
        height: 48px;
    }
    
    .gc-drawer .nav-item i {
        margin-right: 20px;
    }

    .gc-drawer .nav-subtitle, 
    .gc-drawer .nav-item span {
        display: inline; /* Restore text */
    }
    
    .menu-btn {
        display: flex; /* Show menu button on mobile */
    }
    
    .gc-main {
        margin-left: 0; 
        width: 100%;
        padding: 16px;
    }

    .class-grid {
        display: flex;
        flex-direction: column;
    }
    
    .gc-card {
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 280px;
    }
}

