:root {
    --primary: #4f46e5;      /* Indigo */
    --primary-hover: #4338ca;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --error-bg: #fef2f2;
    --error-text: #991b1b;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Card Styling --- */
.modern-card {
    background: var(--card-bg);
    padding: 40px 32px;
    border-radius: 24px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05), 
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(255,255,255,0.5) inset;
    backdrop-filter: blur(10px);
}

.header {
    text-align: center;
    margin-bottom: 16px;
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    background: #e0e7ff;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Input Field --- */
.field {
    position: relative;
    margin-bottom: 24px;
}

.field input, .field .selectTrigger {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 16px 6px 16px; /* uneven padding for floating label */
    height: 56px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: #f9fafb;
    color: var(--text-main);
    transition: all 0.2s ease;
    outline: none;
}

.field input:focus, .customSelect button:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.customSelect button:focus svg path {
    stroke: var(--primary);
}

/* Floating Label Logic */
.field label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.customSelect button:focus label,
.customSelect button .selectLabel:not(.placeholder) + label {
    top: 10px; /* Moves up inside the input */
    transform: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.field input:focus + label, .customSelect button:focus label  {
    color: var(--primary);
}

/* Validation Indicator */
.status-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #10b981;
}

.field input:valid ~ .status-icon {
    transform: translateY(-50%) scale(1);
}

/* --- Button --- */
#submitBtn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#submitBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

#submitBtn:active {
    transform: translateY(0);
}

/* --- Notification Messages --- */
.notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(6, 95, 70, 0.1);
}

.notification.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid rgba(153, 27, 27, 0.1);
}

.notification .icon {
    background: rgba(255,255,255,0.5);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}
/* --- History Box --- */
.history-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow:
        0 4px 6px -1px rgba(0,0,0,0.05),
        0 10px 15px -3px rgba(0,0,0,0.05);
}

.history-card h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-list li {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.history-list li:last-child {
    border-bottom: none;
}

.history-list .room {
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.03em;
}

.history-list .time {
    color: var(--text-muted);
    font-family: monospace;
}
    
.autocomplete {
    position: relative;
}

.suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 50;
    overflow-y: auto;
    max-height: 144px; /* ≈ 3 items */
}

.suggestions.hidden {
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #eef2ff;
    color: var(--primary);
}

#connectionStatus, #queueStatus {
    padding: 6px 12px;
    border-radius: 20px;
    align-self: center;
}

#queueStatus {
    border: solid 1px #fae2cf;
    background-color: #fcf2e6;
    color: #c5831f;
}

.offline {
    border: solid 1px #fad2cf;
    background-color: #fce8e6;
    color: #c5221f;
}

.online {
    border: solid 1px #ceead6;
    background-color: #e6f4ea;
    color: #137333;
}

.info {
    margin: 0;
    text-align: center;
    color: #666;
}