/* 
 * Aanwezigheidsbord Stylesheet
 * Mobile-first responsive design
 */

/* Reset en basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #ed4a95 0%, #ff4fa8 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    margin: 0 auto;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* Ensure admin page is always full-width, without colored side gutters. */
body.page-admin {
    margin: 0;
    padding: 0;
}

body.page-admin .container {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
}

/* Header */
header {
    background: linear-gradient(135deg, #ed4a95 0%, #ff4fa8 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 {
    font-size: 1.5em;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    font-size: 1.2em;
    cursor: pointer;
}

.menu-toggle:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

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

.user-info span {
    font-size: 0.95em;
}

/* Main content */
main {
    flex: 1;
    padding: 30px;
}

/* Footer */
footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #e0e0e0;
}

footer p {
    margin: 5px 0;
}

footer p:last-child {
    margin-bottom: 0;
}

.version-info {
    font-size: 0.8em;
    color: #999;
}

.version-info span {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    cursor: help;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

/* Make header menu buttons a bit smaller/leaner without affecting all buttons */
header .btn {
    padding: 6px 14px;
    font-size: 0.9em;
    border-radius: 4px;
}

.btn-primary {
    background: #ed4a95;
    color: white;
}

.btn-primary:hover {
    background: #b30063;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #ed4a95;
    border: 1px solid white;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.9);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Message */
.message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.message-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.message-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Auth (login/register) */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.auth-box h2 {
    margin-bottom: 25px;
    color: #ed4a95;
    text-align: center;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: #ed4a95;
}

.auth-form button[type="submit"] {
    width: 100%;
    margin-top: 10px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #ed4a95;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Board */
.board-container {
    margin: 0 auto;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #ed4a95;
    color: white;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: bold;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.date-nav-btn:hover {
    background: #b30063;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.date-nav-spacer {
    display: inline-block;
    width: 40px;
    height: 40px;
}

.date-nav-today {
    background: #fbbf24;
    color: #78350f;
}

.date-nav-today:hover {
    background: #d97706;
}

.today-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #78350f;
    display: block;
}

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-selector label {
    font-weight: 500;
    color: #555;
}

.date-selector input[type="date"] {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1em;
}

.presence-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.counter-label {
    font-weight: 500;
    color: #666;
}

.counter-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #10b981;
}

/* Status card */
.my-status-card {
    background: linear-gradient(135deg, #ed4a95 0%, #ff4fa8 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.status-info {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.status-present {
    background: #10b981;
    color: white;
}

.status-absent {
    background: #ef4444;
    color: white;
}

.status-unknown {
    background: #6b7280;
    color: white;
}

.status-time {
    font-size: 0.9em;
    opacity: 0.9;
}

.status-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.info-message {
    background: #dbeafe;
    color: #1e40af;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 500;
}

/* Presence lists */
.presence-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.presence-list {
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.list-title {
    font-size: 1.2em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #e5e7eb;
}

.present-title {
    color: #10b981;
    border-bottom-color: #10b981;
}

.absent-title {
    color: #ef4444;
    border-bottom-color: #ef4444;
}

.empty-list {
    text-align: center;
    color: #9ca3af;
    padding: 30px 10px;
    font-style: italic;
}

.user-list {
    list-style: none;
}

.user-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.user-item:hover {
    transform: translateX(5px);
}

.user-item.present {
    border-left: 4px solid #10b981;
}

.user-item.absent {
    border-left: 4px solid #ef4444;
}

.user-name {
    font-weight: 600;
    color: #333;
}

.inline-name-form {
    display: inline;
    margin: 0;
}

.name-toggle-btn {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.name-toggle-btn:hover {
    color: #1e40af;
}

.badge-you {
    display: inline-block;
    background: #ed4a95;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 5px;
}

.user-time {
    font-size: 0.85em;
    color: #6b7280;
}

/* Quick dates */
.quick-dates {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.quick-dates h4 {
    margin-bottom: 15px;
    color: #555;
}

.date-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-small.active {
    background: #ed4a95;
    color: white;
    font-weight: 600;
}

/* Planning section */
.planning-section {
    background: linear-gradient(135deg, #f3f4f6 0%, #ffffff 100%);
    padding: 30px;
    border-radius: 10px;
    border: 2px dashed #ed4a95;
    margin-top: 30px;
}

.planning-section h3 {
    color: #ed4a95;
    margin-bottom: 10px;
}

.planning-section > p {
    color: #666;
    margin-bottom: 20px;
}

.planning-form {
    margin-bottom: 20px;
}

.planning-weeks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.planning-week-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
    align-items: start;
}

.week-number {
    background: #eef2ff;
    color: #b30063;
    border: 1px solid #f7a3cf;
    border-radius: 6px;
    font-weight: 700;
    text-align: center;
    padding: 10px 6px;
    font-size: 0.9em;
}

.planning-week-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(64px, 1fr));
    gap: 8px;
}

.planning-weekday-header {
    display: grid;
    grid-template-columns: 64px repeat(7, minmax(64px, 1fr));
    gap: 8px;
    align-items: center;
    font-size: 0.75em;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
}

.planning-weekday-header::before {
    content: '';
}

.planning-weekday-header span {
    text-align: center;
}

.planning-day {
    position: relative;
}

.planning-day-hidden {
    pointer-events: none;
}

.planning-day-empty {
    min-height: 56px;
    border-radius: 6px;
    background: transparent;
}

.planning-day input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.planning-day label {
    display: block;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.planning-day input[type="checkbox"]:checked + label {
    background: #10b981;
    color: white;
    border-color: #10b981;
    font-weight: 600;
}

.planning-day.weekend label {
    background: #f3f4f6;
}

.planning-day.weekend input[type="checkbox"]:checked + label {
    background: #f97316;
    border-color: #f97316;
}

.planning-day.today label {
    border-color: #ed4a95;
    background: #ffe6f2;
}

.planning-day.today input[type="checkbox"]:checked + label {
    background: #ed4a95;
}

.date-label {
    display: block;
    font-weight: 500;
    font-size: 0.85em;
}

.badge-today {
    display: inline-block;
    background: #fbbf24;
    color: #78350f;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65em;
    font-weight: 600;
    margin-top: 4px;
}

.planning-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.planning-actions button {
    flex: 1;
    min-width: 150px;
}

.planning-expand {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.planning-expand .btn {
    margin: 0;
}

.planning-weeks-jump-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.planning-weeks-jump-form label {
    font-size: 0.9em;
    color: #4b5563;
    font-weight: 600;
}

.planning-weeks-jump-form select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 8px;
    background: white;
    color: #374151;
}

/* Responsive planning */
@media (max-width: 768px) {
    .planning-weeks {
        padding: 10px;
    }

    .planning-weekday-header {
        display: none;
    }

    .planning-week-row {
        grid-template-columns: 1fr;
    }

    .week-number {
        text-align: left;
        padding: 8px 10px;
    }

    .planning-week-days {
        grid-template-columns: repeat(3, minmax(72px, 1fr));
        gap: 8px;
    }
    
    .planning-actions {
        flex-direction: column;
    }
    
    .planning-actions button {
        min-width: auto;
    }

    .planning-expand {
        justify-content: stretch;
    }

    .planning-expand .btn {
        width: 100%;
    }

    .planning-weeks-jump-form {
        width: 100%;
        justify-content: space-between;
    }
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }
    
    header h1 {
        font-size: 1.4em;
    }
    
    main {
        padding: 20px;
    }

    .menu-toggle {
        display: inline-flex;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
    
    .board-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .presence-counter {
        justify-content: center;
    }
    
    .status-actions {
        flex-direction: column;
    }
    
    .status-actions .btn {
        width: 100%;
    }
    
    .presence-lists {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2em;
    }
    
    header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-title {
        width: 100%;
        justify-content: space-between;
    }

    .user-info {
        display: none;
        width: 100%;
        justify-content: flex-start;
    }

    body.menu-open .user-info {
        display: flex;
    }
    
    main {
        padding: 14px;
    }

    .board-header {
        margin-bottom: 16px;
        padding: 12px;
        gap: 12px;
    }

    .date-selector {
        width: 100%;
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) auto 38px;
        gap: 8px;
        align-items: center;
    }

    .date-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1em;
    }

    .date-nav-prev {
        grid-column: 1;
    }

    .date-picker-wrapper {
        grid-column: 2;
        min-width: 0;
        gap: 6px;
    }

    .date-picker-wrapper label {
        font-size: 0.95em;
    }

    .date-selector input[type="date"] {
        width: 100%;
        min-width: 0;
        padding: 6px 8px;
        font-size: 0.95em;
    }

    .date-nav-next {
        grid-column: 4;
    }

    .date-nav-today {
        grid-column: 3;
    }

    .date-selector .btn-secondary {
        grid-column: 1 / -1;
        width: 100%;
    }

    .presence-counter {
        padding: 10px 12px;
    }

    .counter-value {
        font-size: 1.5em;
    }

    .my-status-card,
    .presence-list,
    .quick-dates,
    .planning-section {
        padding: 14px;
        margin-bottom: 16px;
    }

    .info-message {
        padding: 12px;
        margin-bottom: 16px;
    }

    .list-title {
        font-size: 1.05em;
        margin-bottom: 10px;
    }
}

/* Animaties */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-item {
    animation: fadeIn 0.3s ease-out;
}
/* Profiel styling */
.user-name-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(255,255,255,0.5);
    transition: border-color 0.2s;
}

.user-name-link:hover {
    border-bottom-color: white;
}

.profile-container {
    margin: 0 auto;
    animation: fadeIn 0.3s ease-out;
}

.profile-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #ed4a95;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    font-style: italic;
}

.profile-form hr {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.profile-form h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #333;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.form-actions .btn {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    transition: transform 0.1s, box-shadow 0.1s;
}

.form-actions .btn:active {
    transform: scale(0.98);
}

@media (max-width: 600px) {
    .profile-form {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Responsive tabelas admin */
.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: #ed4a95;
    color: white;
}

.admin-table th {
    text-align: left;
    padding: 12px 20px;
    border-bottom: 2px solid #ed4a95;
    font-weight: 600;
}

.admin-table td {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f1f1;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f9f9f9;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.table-actions form {
    display: inline-flex;
}

.table-actions button {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .admin-table {
        font-size: 0.95em;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        margin-bottom: 16px;
        border: 1px solid #ddd;
        border-radius: 6px;
        overflow: hidden;
    }

    .admin-table td {
        padding: 12px;
        position: relative;
        padding-left: 140px;
        border-bottom: 1px solid #f1f1f1;
    }

    .admin-table td:last-child {
        border-bottom: none;
    }

    .admin-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        top: 12px;
        font-weight: 600;
        color: #ed4a95;
        width: 120px;
        word-break: break-word;
    }

    .table-actions {
        flex-direction: column;
        gap: 6px;
    }

    .table-actions form {
        display: block;
        width: 100%;
    }

    .table-actions button {
        display: block;
        width: 100%;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .admin-table td {
        padding: 10px;
        padding-left: 100px;
    }

    .admin-table td::before {
        left: 10px;
        top: 10px;
        width: 80px;
        font-size: 0.85em;
    }
}


