:root {
    --primary: black;
    --primary-dark: #4338ca;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-800: #1f2937;
    /* Increased base font size for better readability */
    font-size: 28px;
}

/* Mobile first */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--gray-100);
    min-height: 100vh;
    box-sizing: border-box;
    width: 100%;
    /* Increased base font size */
    font-size: 28px;
}

h1 {
    width: 100%;
    color: var(--gray-800);
    /* Larger heading */
    font-size: 2.8rem;
    text-align: center;
    /* Reduced padding */
    padding: 1rem 0;
    margin: 0;
}

form {
    width: 100%;
    /* Reduced padding */
    padding: 1rem;
    box-sizing: border-box;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    /* Increased height for better touch targets */
    height: 4rem;
    padding: 0 1rem;
    /* Reduced margin */
    margin-bottom: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    /* Larger font size */
    font-size: 1.6rem;
    box-sizing: border-box;
}

button {
    width: 100%;
    /* Increased height for better touch targets */
    height: 4rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    /* Larger font size */
    font-size: 1.6rem;
    font-weight: 600;
    /* Reduced margin */
    margin-top: 1rem;
}

button:active {
    background: var(--primary-dark);
}

.student-list {
    display: grid;
    grid-template-columns: 1fr;
    /* Reduced gap */
    gap: 0.75rem;
    /* Reduced padding */
    padding: 0.75rem;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    list-style: none;
}

.student-item {
   background: white;
   padding: 1rem;
   border-radius: 12px;
   box-shadow: 0 2px 4px rgba(0,0,0,0.1);
   display: flex;
   justify-content: space-between;
   align-items: center;
   font-size: 1.6rem;
   gap: 1rem;
}

.action-group {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   flex-shrink: 0;
}

.name {
   flex: 1;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    /* Larger font size */
    font-size: 1.4rem;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Reduced padding */
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    /* Increased width for better content display */
    width: 98%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1000;
    background: gold;
}

.modal h3 {
    margin-top: 0;
    color: var(--gray-800);
    /* Larger font size */
    font-size: 1.6rem;
}

.modal button {
    display: block;
    width: 100%;
    /* Reduced margin */
    margin: 0.5rem 0;
}

.modal button:last-child {
    background: var(--gray-200);
    color: var(--gray-800);
}

.history-entry {
    background: var(--gray-100);
    /* Reduced padding */
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    text-align: left;
    /* Larger font size */
    font-size: 1.4rem;
}

.icon-button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    /* Larger icon size */
    font-size: 1.8rem;
    margin-left: 0.5rem;
}

.add-student-section {
    width: 100%;
    /* Reduced padding */
    padding: 1rem;
    box-sizing: border-box;
    text-align: center;
}

.add-student-section h2 {
    /* Larger font size */
    font-size: 1.6rem;
    /* Reduced margin */
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.logout-button {
    width: 95%;
    max-width: 400px;
    height: 4rem;
    /* Reduced margin */
    margin: 1rem auto;
    display: block;
    /* Larger font size */
    font-size: 1.6rem;
    background: gold;
    color: white;
}

.manage-button {
    width: 95%;
    max-width: 400px;
    /* Reduced margin */
    margin: 1rem auto;
}

.manage-student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Reduced padding */
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    /* Larger font size */
    font-size: 1.4rem;
}

.remove-button {
    background: #dc2626;
    padding: 0.5rem 1rem;
    margin: 0;
    /* Larger font size */
    font-size: 1.4rem;
}

/* Desktop */
@media (min-width: 768px) {
    body {
        max-width: 800px;
        margin: 0 auto;
        padding: 1rem;
        /* Adjusted desktop font size but kept it larger than original */
        font-size: 20px;
    }

    form,
    .add-student-section {
        max-width: 500px;
        margin: 0 auto;
    }

    .modal {
        width: 500px;
    }

    button {
        width: auto;
        padding: 0 1.5rem;
        /* Larger font size for desktop */
        font-size: 1.5rem;
    }

    .student-item {
        /* Larger font size for desktop */
        font-size: 1.5rem;
    }

    .modal h3 {
        /* Larger font size for desktop */
        font-size: 1.2rem;
    }

    .history-entry,
    .manage-student-item {
        /* Larger font size for desktop */
        font-size: 1.1rem;
    }

    .logout-button,
    .manage-button {
        width: 95%;
    }

    .student-list {
        grid-template-columns: repeat(1fr);
        max-width: 800px;
        margin: 0 auto;
    }
}

#reportModal {
	width:90%!important;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    width: 100%;
}

.report-header {
    font-weight: bold;
    padding: 0.5rem;
    background: var(--gray-800);
    color: white;
    text-align: center;
    border-radius: 8px;
}

.report-row {
    display: contents;
}

.report-cell {
    padding: 0.5rem;
    text-align: center;
    background: var(--gray-100);
    border-radius: 8px;
}


.disabled-button {
    opacity: 0.5;
    cursor: not-allowed;
}

.active-pass {
    color: black;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-right: 8px;
}

.status-message {
    text-align: center;
    font-weight: bold;
    padding: 8px;
    border-radius: 4px;
    background-color: #fff3e0;
}

button.disabled-button {
    background: gray;
}

@media (max-width: 768px) {
    .report-grid {
        font-size: 1.2rem;
        gap: 0.25rem;
    }
    
    .report-cell, .report-header {
        padding: 0.25rem;
    }
}
