body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    background-color: #f9f9f9;
    color: #333;
}

header {
    display: none;
}

.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    z-index: 100;  /* Update z-index */
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.sidebar-header p {
    margin: 5px 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.nav-links {
    flex: 1;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.2s;
}

.nav-links a:hover {
    opacity: 1;
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
    padding-left: 10px;
}

.user-section {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.user-info .fa-user {
    opacity: 0.8;
}

.user-info .username-link {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.2s;
}

.user-info .username-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.logout-link {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.2s;
}

.logout-link:hover {
    opacity: 1;
    color: #e74c3c;
}

.main-content {
    margin-left: 250px;
    padding: 10px;
    width: calc(100vw - 250px);
}

.container {

}

h1 {
    margin: 0 0 0 0;  /* Remove default top margin, add bottom margin */
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    text-align: left;
    margin-bottom: 20px;
    width: calc(100vw - 290px);
}

table th, table td {
    border: 1px solid #ddd;
    padding: 10px;
}

table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

table tr:nth-child(even) {
    background-color: #f2f2f2;
}

table tr:nth-child(odd) {
    background-color: #fafafa;
}

table tr:hover {
    background-color: #ddd;
}

/* Base button styles */
.btn {
    display: inline-flex;  /* Change to inline-flex */
    justify-content: center;  /* Center content horizontally */
    align-items: center;  /* Center content vertically */
    padding: 8px 15px;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    margin: 0;
    background-color: #007bff;
    transition: background-color 0.3s;
    min-width: 100px;  /* Increase minimum width */
    height: 35px;  /* Set fixed height */
    box-sizing: border-box;
}

/* Remove the generic button style that adds margin-top */
button {
    margin: 0;  /* Remove default margin */
}

.btn:hover {
    background-color: #0166d2;
}

/* Button variants */
.btn-success {
    background-color: #4CAF50;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-back {
    background-color: #9a9a9a;
}

.btn-back:hover {
    background-color: #868686;
}

/* Position modifier for back button */
.btn-fixed-top {
    position: absolute;
    top: 25px;
    right: 20px;
}

.dashboard-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    margin: 0 auto;
}

.dashboard-link-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    color: white;
    background-color: #007bff;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    height: 10px;
    font-size: 16px;
    text-align: center;
}

.dashboard-link-btn:hover {
    background-color: #217dbb;
}

h3 {
    margin-top: 0px;
}

h2 {
    margin: 0;
    margin-bottom: 10px;
}

/* Dropdown styles */
.sheet-select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    background-color: white;
}

.sheet-select:focus {
    outline: none;
    border-color: #007bff;
}

dropdown {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    background-color: white;
}

.sheet-select:focus {
    outline: none;
    border-color: #007bff;
}

.sheet-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sheet-form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

------------

.form-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: left;
    gap: 10px;
}

.form-group select, .form-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}
.form-group input[type="checkbox"] {
    min-width: auto;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
hr {
    margin: 20px 0 20px 0;
    border: none;
    border-top: 1px solid #ddd;
}
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}
.data-table th,
.data-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}
.data-table thead {
    background-color: #f5f5f5;
}
.data-table .action-col {
    width: 100px;
    text-align: center;
}
.data-table .delete-btn {
    padding: 4px 8px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.data-table .delete-btn:hover {
    background-color: #cc0000;
}
.header-map-dropdown {
    width: 100%;
    padding: 4px;
}
.data-row:nth-child(even) {
    background-color: #f9f9f9;
}
.data-row:hover {
    background-color: #f5f5f5;
}
.resolution-select {
    width: 100%;
    padding: 10px;
    border: 0px solid #dddddd00;
    border-radius: 4px;
    font-size: 14px;
    background-color: transparent;
    cursor: pointer;
}

.resolution-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.resolution-select optgroup {
    font-weight: bold;
    color: #666;
}

.resolution-select option {
    padding: 8px;
}

.resolution-select option:hover {
    background-color: #f0f0f0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    margin: 30px 0;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.dashboard-container {
    position: relative;
    width: calc(100vw - 250px);
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.dashboard-content {
    width: 100%;
    margin-top: auto;
}

.main-content.dashboard {
    width: calc(100vw - 250px);
    margin-left: 250px;
    padding: 0;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-links {
    width: 100%;
    margin: 20px 0;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.ball {
  position: absolute;  /* Change from fixed to absolute */
  border-radius: 100%;
  opacity: 0.3;
  pointer-events: none;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    
}

.search-input {
    height: 35px;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 300px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

/* Table column widths */
.col-matric {
    width: 65px;
    max-width: 65px;
}

.col-matric, 
.col-matric td {
    width: 65px;
    max-width: 65px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-room {
    width: 100px;
    max-width: 100px;
}

.col-room,
.col-room td {
    width: 100px;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Student details table styles */
.info-table th {
    width: 200px;
    min-width: 200px;
}

.info-table input,
.info-table select {
    width: 100%;
    border: none;
    border-bottom: #cccccc solid 1px;
    background: transparent;
    font-size: 16px;
    box-sizing: border-box;
    height: 100%;
    padding: 8px 0;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.info-table input:focus,
.info-table select:focus {
    outline: none;
    border-bottom: #868686 solid 1px;
}

.info-table select {
    background: url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right transparent;
    padding-right: 25px;
}

.info-table th.matric,
.info-table td:first-child {
    width: 70px;  /* Fixed width for matric column */
    min-width: 70px;
    max-width: 70px;
}


.info-table th.value,
.info-table td:first-child {
    width: 30px;  /* Fixed width for matric column */
    min-width: 30px;
    max-width: 30px;
}

.info-table th.action,
.info-table td:first-child {
    width: 100px;  /* Fixed width for matric column */
    min-width: 100px;
    max-width: 100px;
}

.info-table th.name,
.info-table td:first-child {
    width: 500px;  /* Fixed width for matric column */
    min-width: 500px;
}

/* Table scrolling and fixed column widths */
.table-wrapper {
    width: calc(100vw - 290px); /* Account for sidebar width + padding */
    overflow-x: auto;
    margin-bottom: 1rem;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;  /* Important for fixed column widths */
}

/* Define fixed column widths */
.info-table th.matric,
.info-table td:matric {
    width: 100px;
    max-width: 100px;
}

.info-table th.name,
.info-table td:name {
    width: 300px;
}

.info-table th.value,
.info-table td:value {
    width: 100px;
}

.info-table th.action,
.info-table td:action {
    width: 120px;
}

/* Fixed header styles */
.page-header {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    background: white;
    padding: 20px;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;  /* Allow content to wrap */
    justify-content: space-between;
    align-items: center;
    gap: 15px;  /* Space between wrapped elements */
}

.page-header .content p {
    margin: 5px 0 0 0;
    color: #666;
}

.page-header .buttons {
    display: flex;
    gap: 10px;
}

/* Add padding to main content to account for fixed header */
.page-content {
    /* Remove fixed margin-top, will be set by JavaScript */
    position: relative;
    padding: 10px;
    transition: margin-top 0.2s ease; /* Smooth transition when header height changes */
}

.session-select {
    max-width: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    background-color: white;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    margin: 0;
    min-width: 100px;  /* Increase minimum width */
    height: 35px;  /* Set fixed height */
}

.session-select:focus {
    outline: none;
    border-color: #007bff;
}

.username-link {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.username-link:hover {
    opacity: 0.8;
}

.profile-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: bold;
    color: #333;
}

.form-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.profile-form button {
    padding: 12px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.profile-form button:hover {
    background: #34495e;
}

/* Mobile menu button */
.mobile-menu-button {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1002;
    background: #2c3e50;
    color: white;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Media queries for responsive design */
@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden;  /* Prevent body horizontal scroll */
    }

    .mobile-menu-button {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0px;
        overflow-x: hidden;  /* Prevent main content horizontal scroll */
        box-sizing: border-box;
    }

    /* Update header styles for mobile */
    .page-header {
        left: 0;
        right: 0;
        padding: 10px;
        width: 100%;
        position: relative;
        box-sizing: border-box;
        max-width: 100%;  /* Ensure header doesn't cause overflow */
    }

    .page-header .content {
        text-align: left;
        width: 100%;
        padding: 0;
        z-index: 10;
    }

    .page-header .content h1 {
        padding: 0;
        margin-bottom: 10px;
    }

    .page-header .buttons {
        padding: 0;
        margin: 0;
        width: 100%;
    }

    .page-header .buttons .btn,
    .page-header .buttons .session-select {
        flex: 1;
        min-width: 0;
        margin: 0;
    }

    .page-header .buttons > * {
        flex-basis: calc(50% - 5px);
    }

    /* Adjust table display for mobile */
    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        padding-right: 0;
    }

    /* Update table styles for mobile */
    table {
        width: auto;
        min-width: 100%;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .info-table {
        width: auto;
        min-width: 100%;
    }

    /* Make text more readable on mobile */
    body {
        font-size: 16px;
    }

    /* Adjust dashboard grid */
    .dashboard-links {
        grid-template-columns: 1fr;
    }

    /* Adjust stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Adjust form layouts */
    .form-group {
        flex-direction: column;
    }

    .form-group input,
    .form-group select {
        width: 100%;
    }

    /* Adjust search bar */
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        min-width: unset;
    }

    /* Adjust buttons */
    .btn {
        width: 100%;
        margin: 5px 0;
    }

    /* Adjust fixed header for mobile */
    .page-header {
        position: relative;
        flex-direction: column;
    }

    .page-header .buttons {
        flex-direction: column;
        width: 100%;
    }

    /* Adjust table column widths for mobile */
    .info-table th,
    .info-table td {
        min-width: 100px;
    }

    .profile-container {
        margin: 20px 10px;
    }

    /* Update dashboard container styles */
    .dashboard-wrapper {
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .dashboard-container {
        width: 100%;
        padding: 15px;
        height: auto;
        min-height: 100vh;
    }

    .dashboard-content {
        gap: 15px;
    }

    .dashboard-link-btn {
        height: auto;
        padding: 20px;
        white-space: normal;
    }

    .stats-grid {
        margin: 15px 0;
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 15px;
    }

    .main-content.dashboard {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }

    .table-responsive {
        margin: 0 ;
        width: 100%;
        border: none;

    }

    table {
        margin: 0;
        border: none;
        white-space: nowrap;
    }

    table th, table td {
        white-space: nowrap;
    }
}

@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-title h1 {
        font-size: 24px;
    }

    .dashboard-title p {
        font-size: 14px;
    }

    .sidebar-header h1 {
        font-size: 1.2em;
    }

    .sidebar-header p {
        font-size: 0.8em;
    }

    table {
        font-size: 14px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }
}

/* Table scrolling wrapper */
.table-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    background:
        linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
        linear-gradient(to right, rgba(255, 255, 255, 0), white 70%) 0 100%,
        radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)),
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-position: 0 0, 100% 0, 0 0, 100% 0;
    background-attachment: local, local, scroll, scroll;
}

/* Update existing table styles */
table {
    min-width: 100%;
    width: auto;
    margin-bottom: 0;
}


