/* --- CSS STYLING --- */
:root {
    /* PALETTE MAPPING */
    --primary: #6EC1E4;       /* Light Blue */
    --secondary: #54595F;     /* Charcoal Grey */
    --text-grey: #7A7A7A;     /* Grey Text */
    --accent: #61CE70;        /* Green */
    --danger: #FF0000;        /* Bright Red */
    --white: #ffffff;
    --bg-color: var(--secondary);
    --clock-face: var(--white);
    --clock-border: var(--primary);
    --hand-color: var(--secondary); /* Dark hands on white face */
    --second-hand: var(--danger);   /* Red second hand */
    --main-text-color: var(--white); /* White text on the dark body bg */
    --card-bg: var(--white);
    --card-text: var(--text-grey);
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: var(--bg-color);
    font-family: 'Segoe UI', sans-serif;
    color: var(--main-text-color);
    padding: 5px;
    gap: 10px;
    box-sizing: border-box;
}

.user-form {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 450px; /* Limit width on huge screens */
    margin-bottom: 15px; /* Space between form and clock */
    border-top: 6px solid var(--primary);
    /* border-bottom: 4px solid var(--primary); */
    box-sizing: border-box;
    transition: opacity 0.5s ease;
}

.form-title {
    color: var(--secondary);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    /* letter-spacing: 1px; */
    margin-bottom: 25px;
}

.fields-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fields-row {
    display: flex; /* Horizontal Layout */
    gap: 15px;
    width: 100%;
}

.input-group {
    flex: 1; /* Each input takes equal space */
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Segoe UI', sans-serif;
    color: var(--secondary);
    box-sizing: border-box;
    transition: 0.2s;
    background-color: #f9f9f9;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(110, 193, 228, 0.2);
}

input.invalid {
    border-color: var(--danger);
    background-color: #fff0f0;
}

.confirm-btn {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.confirm-btn:hover {
    filter: brightness(0.9);
}

.error-msg {
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 5px;
    min-height: 1.2em;
}

/* --- MAIN CONTENT LAYOUT --- */
.main-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 850px;
}

.left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.right-col {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* The Clock Container */
.clock {
    width: 350px;
    height: 350px;
    background: var(--clock-face);
    border-radius: 50%;
    /* New Border Color: Primary Blue */
    border: 15px solid var(--clock-border);
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    margin-bottom: 30px;
}

/* Clock Hands */
.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: var(--hand-color);
    border-radius: 4px;
    z-index: 10;
}

.hour { width: 8px; height: 90px; margin-left: -4px; }
.minute { width: 6px; height: 130px; margin-left: -3px; }

/* Second hand uses the Custom Red */
.second { 
    width: 2px; 
    height: 140px; 
    margin-left: -1px; 
    background: var(--second-hand); 
    z-index: 11; 
}

.pin {
    position: absolute;
    top: 50%; left: 50%;
    width: 16px; height: 16px;
    background: var(--hand-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 12;
}

.marker {
    position: absolute;
    width: 4px; height: 15px;
    background: #bdc3c7; /* Subtle grey markers */
    left: 50%; margin-left: -2px; top: 10px;
    transform-origin: 50% 165px;
    z-index: 5;
}

/* Watermark Styles (Maintained) */
.watermark {
    position: absolute;
    top: 30%; 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    z-index: 1;
    pointer-events: none;
}

.watermark.standard {
    opacity: 0.15;
    filter: grayscale(100%);
}

.watermark.inverted {
    opacity: 0.5;
    filter: invert(100%);
}

/* Date Display */
.date-display {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 400;
    color: var(--white);
    opacity: 0.9;
}

/* Message Box - Updated to White Card style */
.message-card {
    background-color: var(--card-bg);
    color: var(--card-text);
    padding: 20px;
    border-radius: 10px;
    border-left: 6px solid var(--primary); /* Blue accent border */
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.message-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary); /* Blue label */
    font-weight: 700;
    margin-bottom: 5px;
}

.message-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary); /* Dark text for readability */
}

/* API Console */
.api-console {
    background-color: #1e1e1e; /* Keep console dark for code contrast */
    color: var(--accent); /* Green text looks like matrix/terminal */
    font-family: 'Courier New', monospace;
    padding: 15px;
    border-radius: 8px;
    height: 150px;
    overflow-y: auto;
    font-size: 0.8rem;
    border: 1px solid #333;
}

.log-entry { margin-bottom: 5px; border-bottom: 1px solid #333; padding-bottom: 2px; }
.log-time { color: #888; margin-right: 10px; }

/* Controls */
.controls { display: flex; gap: 15px; width: 100%; }

button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Start Button = Green Accent */
#startBtn { background-color: var(--accent); }
#startBtn:hover { filter: brightness(1.1); }

/* Skip Mode = Primary Blue */
#startBtn.skipping { background-color: var(--primary); }

#startBtn:disabled { 
    background-color: #95a5a6; 
    cursor: not-allowed; 
    opacity: 0.7; 
    box-shadow: none;
}

/* Stop Button = Custom Red */
#stopBtn { background-color: var(--danger); }
#stopBtn:hover { filter: brightness(1.1); }

/* --- BOOKING REF CARD --- */
.ref-card {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 6px solid var(--accent); /* Green accent to differentiate */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ref-card label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 700;
}

/* Specific styling for the Ref Input */
#bookingRefInput {
    border: 2px dashed #ccc; /* Dashed line suggests "System generated" */
    background-color: #f0f0f0;
    font-family: 'Courier New', monospace; /* Monospace for ID look */
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--secondary);
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#bookingRefInput:focus {
    border-color: var(--accent);
    background-color: #fff;
    outline: none;
}