/* General styles */
body,
html {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Full viewport height */
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    /* Spread the icons to left and right */
    align-items: center;
    /* Vertically align icons */
    padding: 10px;
    background-color: #f8f9fa;
}

.icon {
    font-size: 24px;
    cursor: pointer;
    color: #333;
    transition: color 0.3s;
}

.icon:hover {
    color: #007bff;
}

.header-group {
    display: flex;
    gap: 16px;
}

#user-icon.logged-in {
    color: red;
}

/* Bottom drawer */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 10;
}

.drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.25s ease-out;
    z-index: 11;
    padding: 8px 20px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.drawer.open {
    transform: translateY(0);
}

.drawer-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #ccc;
    margin: 0 auto 12px;
}

.drawer-title {
    margin: 0 0 12px;
    font-size: 20px;
}

.drawer-line {
    margin: 6px 0;
    font-size: 15px;
}

.drawer-line i {
    width: 20px;
    color: #666;
}

.drawer-hint {
    margin: 8px 0;
    font-size: 13px;
    color: #666;
}

.drawer-error {
    margin: 8px 0;
    color: #c00;
    font-size: 14px;
}

.drawer-actions {
    margin-top: 16px;
}

.drawer-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
}

.drawer-btn.primary {
    background: red;
    color: #fff;
}

.drawer-btn.danger {
    background: #fff;
    color: red;
    border: 2px solid red;
}

.drawer-btn.secondary {
    background: #eee;
    color: #333;
}

.drawer-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.reminder-toggle {
    margin: 12px 0;
    font-size: 15px;
}

.reminder-toggle input {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    accent-color: red;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

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

/* Reduce vertical spacing between buttons */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    background-color: #f4f4f4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* Visual separation */
}

.grid-container>* {
    display: flex;
    justify-content: center;
    /* Center horizontally */
    align-items: center;
    /* Center vertically */
}


.table-container {
    flex-grow: 1;
    /* This allows the table container to take up the remaining space */
    overflow-y: auto;
    /* Make the table scrollable */
}

/* Default button styles (non-active state) */
.toggle-btn {
    width: 70px;
    /* Make the buttons circular */
    height: 70px;
    /* Same width and height */
    background-color: #f0f0f0;
    color: black;
    border: 1px solid #ddd;
    cursor: pointer;
    border-radius: 50%;
    /* Make the button completely circular */
    transition: background-color 0.3s, box-shadow 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-btn i {
    font-size: 20px;
    /* Increase the size of the icons */
}

/* Hover effect for non-active buttons */
.toggle-btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    /* Add shadow on hover */
}

/* Disable hover effects on touch devices */
@media (hover: none) {
    .toggle-btn:hover {
        box-shadow: none;
        /* Remove hover effect on touch devices */
    }
}

/* Active button state - buttons that are 'on' */
.toggle-btn.active {
    background-color: red;
    color: white;
    /* Optional: text color for better readability */
}


/* Table styling */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.main-table td:first-child {
    width: 25%;
    /* Left column wider for the date */
    text-align: left;
    /* Align text to the left */
    white-space: nowrap;
}

.main-table td:nth-child(2) {
    width: 70%;
    /* Right column for activity, location, and instructor */
}

.main-table tbody tr {
    cursor: pointer;
}

.main-table td.marker {
    width: 5%;
    text-align: center;
    color: #bbb;
}

.main-table .mine-icon,
.main-table .waiting-icon {
    display: none;
    color: #2e8b57;
}

.main-table tr.mine td:first-child,
.main-table tr.mine-waiting td:first-child {
    border-left: 5px solid #2e8b57;
}

.main-table tr.mine .mine-icon,
.main-table tr.mine-waiting .waiting-icon {
    display: inline;
}

.main-table tr.mine .chevron,
.main-table tr.mine-waiting .chevron {
    display: none;
}

.main-table .details {
    display: flex;
    flex-direction: column;
    /* Stack the details vertically */
}

.main-table .activity,
.main-table .location,
.main-table .instructor {
    display: block;
    /* Each detail will be a separate line */
}

.main-table .activity i,
.main-table .location i,
.main-table .instructor i {
    margin-right: 5px;
    /* Add some space between icon and text */
}

/* Table in settings.html with narrower checkbox column */
.settings-table td:first-child {
    width: 10%;
    /* Narrower checkbox column */
}

.main-table td:first-child .start-time,
.main-table td:first-child .capacity {
    display: block;
}

.main-table .capacity {
    margin-top: 4px;
}

.main-table .capacity i {
    margin-right: 4px;
}

/* Even rows styling for settings table */
.settings-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Main table: separator lines instead of zebra striping, so the tints stand out */
.main-table td {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 2px solid #ccc;
}

/* Capacity tints: nearly full, full, cancelled */
.main-table tr.status-almost {
    background-color: #ffe6c7;
}

.main-table tr.status-full {
    background-color: #ffd1d1;
}

.main-table tr.status-cancelled {
    background-color: #e6e6e6;
    color: #888;
}

.main-table tr.status-cancelled .activity {
    text-decoration: line-through;
}

/* Responsive adjustments for table on small screens */
@media (max-width: 480px) {

    .table th,
    .table td {
        padding: 6px;
        font-size: 12px;
    }
}