@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 17px;
    line-height: 1.75em;
    font-weight: 300;
    color: #ffffff;
    background: #1b1f22;
    position: relative;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.5em;
    margin: 0 0 1em 0;
    color: #ffffff;
}

h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.35em; }
h4 { font-size: 1.1em; }

/* Background */
#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#bg:before, #bg:after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#bg:before {
    background: radial-gradient(circle, rgba(27, 31, 34, 0.9) 0%, rgba(27, 31, 34, 0.95) 100%);
    z-index: 2;
}

#bg:after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 1;
    animation: bg-animation 60s linear infinite;
}

@keyframes bg-animation {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

.container {
    position: relative;
    z-index: 3;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    margin-bottom: 30px;
}

.header .logo {
    display: inline-block;
    border: 2px solid #ffffff;
    border-radius: 100%;
    font-size: 1.5em;
    font-weight: 700;
    height: 2.5em;
    line-height: 2.5em;
    width: 2.5em;
    margin: 0 0 1em 0;
    color: #18bfef;
    background: rgba(255, 255, 255, 0.05);
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

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

.user-info-bar {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    position: relative;
    z-index: 3;
}

.user-info {
    display: none !important;
}

.logout-btn {
    background: rgba(24, 191, 239, 0.2);
    border: 1px solid #18bfef;
    color: #18bfef;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(24, 191, 239, 0.3);
}

.auth-container, .form-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 40px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.auth-tab.active {
    color: #18bfef;
    border-bottom-color: #18bfef;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 0.95em;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    font-family: 'Source Sans Pro', sans-serif;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

input:focus, select:focus {
    outline: none;
    border-color: #18bfef;
    background: rgba(255, 255, 255, 0.08);
}

input:disabled, select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

select option {
    background: #2c3e50;
    color: #ffffff;
}

.btn {
    background: #18bfef;
    color: #1b1f22;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover {
    background: #1fd0ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(24, 191, 239, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.submit-btn {
    background: #27ae60;
    color: #ffffff;
}

.submit-btn:hover {
    background: #2ecc71;
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.3);
}

.client-list {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #18bfef;
    transition: all 0.2s;
}

.client-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.client-info {
    font-weight: 400;
}

.client-info strong {
    color: #18bfef;
}

.client-info small {
    opacity: 0.7;
}

/* Client selection checkbox */
.client-selection-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #18bfef;
}

.client-selection-checkbox:hover {
    opacity: 0.8;
}

#selectedClientCount {
    font-size: 14px;
    color: #64748b;
    margin-top: 10px;
    text-align: center;
    font-weight: 400;
}

.use-btn {
    background: #27ae60;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 4px;
}

.use-btn:hover {
    background: #2ecc71;
}

.delete-btn {
    background: #e74c3c;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 4px;
    margin-left: 5px;
}

.delete-btn:hover {
    background: #c0392b;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.checkbox-group label {
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 6px;
    position: relative;
}

.checkbox-group label span {
    display: inline-block;
}

.checkbox-group label:hover {
    background-color: rgba(0, 102, 204, 0.05);
}

/* Hide default checkbox */
.checkbox-group input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom checkbox */
.checkbox-group label::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background-color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Hover state */
.checkbox-group label:hover::before {
    border-color: #0066cc;
}

/* Checked state */
.checkbox-group input[type="checkbox"]:checked + label::before,
.checkbox-group label:has(input[type="checkbox"]:checked)::before {
    background-color: #0066cc;
    border-color: #0066cc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Focus state for accessibility */
.checkbox-group input[type="checkbox"]:focus + label::before,
.checkbox-group label:has(input[type="checkbox"]:focus)::before {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

/* Collapsible options */
.preference-option {
    padding: 0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    background: #5a5a5a;
    transition: all 0.3s ease;
}

.preference-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    background: transparent;
}

.preference-header:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.preference-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.collapse-icon {
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
    color: #64748b;
}

.preference-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.preference-content {
    padding: 0 20px 20px 20px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #5a5a5a;
}

.preference-content.collapsed {
    max-height: 0;
    padding: 0 20px;
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
}

.status-success {
    background: rgba(39, 174, 96, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.4);
}

.status-error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.status-info {
    background: rgba(24, 191, 239, 0.2);
    color: #18bfef;
    border: 1px solid rgba(24, 191, 239, 0.4);
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #ffffff;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #18bfef;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Admin Interface Styles */
.admin-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.user-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid #ffc107;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-card.approved {
    border-left-color: #27ae60;
}

.user-card strong {
    color: #18bfef;
}

.user-card small {
    opacity: 0.8;
}

.approve-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    font-weight: 600;
    transition: all 0.2s;
}

.approve-btn:hover {
    background: #2ecc71;
}

.reject-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.reject-btn:hover {
    background: #c0392b;
}

.admin-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.admin-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-weight: 600;
}

.admin-tab.active {
    color: #18bfef;
    border-bottom-color: #18bfef;
}

.admin-content {
    display: none;
}

.admin-content.active {
    display: block;
}

.notification-badge {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 11px;
    margin-left: 5px;
    font-weight: 700;
}

/* Time slot preference boxes */
.preference-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.preference-box.priority-1 {
    border-left: 4px solid #27ae60;
}

.preference-box.priority-2 {
    border-left: 4px solid #ffc107;
}

.preference-box.priority-3 {
    border-left: 4px solid #e74c3c;
}

.preference-box h4 {
    margin-bottom: 15px;
}

.preference-box.priority-1 h4 {
    color: #27ae60;
}

.preference-box.priority-2 h4 {
    color: #ffc107;
}

.preference-box.priority-3 h4 {
    color: #e74c3c;
}

.date-warning {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 30px 15px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .auth-container, .form-container {
        padding: 25px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .user-info {
        position: static;
        margin-top: 15px;
        text-align: center;
    }

    .client-item {
        flex-direction: column;
        gap: 15px;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
}