/* CSS RESET & VARIABLES - LIGHT BLUE THEME */
:root {
    --bg-dark: #f0f7ff; /* Very light sky blue */
    --bg-panel: rgba(255, 255, 255, 0.75);
    --border-color: rgba(14, 165, 233, 0.15); /* Soft sky blue borders */
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --color-cyan: #0284c7; /* Sky 600 (Main Accent) */
    --color-cyan-glow: rgba(2, 132, 199, 0.15);
    --color-green: #059669; /* Emerald 600 */
    --color-green-glow: rgba(5, 150, 105, 0.15);
    --color-red: #dc2626; /* Red 600 */
    --color-red-glow: rgba(220, 38, 38, 0.1);
    --color-orange: #d97706; /* Amber 600 */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --card-shadow: 0 10px 30px -10px rgba(2, 132, 199, 0.12), 0 1px 3px rgba(2, 132, 199, 0.05);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.08) 0px, transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* APP LAYOUT CONTAINER */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100vh;
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 2.5rem;
    animation: bounce 3s ease-in-out infinite;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    background: linear-gradient(to right, #0284c7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.18);
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-green);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--color-green);
    box-shadow: 0 0 8px rgba(5, 150, 105, 0.5);
    animation: pulse 1.5s infinite;
}

/* PANELS */
.app-main {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.panel-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.admin-badge {
    background: rgba(2, 132, 199, 0.08);
    color: var(--color-cyan);
    border: 1px solid rgba(2, 132, 199, 0.18);
}

.customer-badge {
    background: rgba(217, 119, 6, 0.08);
    color: var(--color-orange);
    border: 1px solid rgba(217, 119, 6, 0.18);
}

/* BAYS GRID */
.bays-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.bay-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(2, 132, 199, 0.1);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bay-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(2, 132, 199, 0.25);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.05);
}

.bay-card.active-selection {
    border-color: var(--color-cyan);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.15);
}

.bay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.bay-number {
    font-size: 1.1rem;
    font-weight: 800;
}

.valve-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.status-closed {
    background: rgba(220, 38, 38, 0.08);
    color: var(--color-red);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.status-open {
    background: rgba(2, 132, 199, 0.08);
    color: var(--color-cyan);
    border: 1px solid rgba(2, 132, 199, 0.3);
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.1);
    animation: blink 2s infinite;
}

.bay-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.timer-display {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.bay-card.active-valve .timer-display {
    color: var(--color-cyan);
    text-shadow: 0 0 1px rgba(2, 132, 199, 0.1);
}

.bay-status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.bay-card.active-valve .bay-status-text {
    color: var(--color-cyan);
    font-weight: 600;
}

/* WATER SIMULATION EFFECT IN CARD */
.water-flow-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0) 50%, rgba(14, 165, 233, 0.08) 100%);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.bay-card.active-valve .water-flow-indicator {
    opacity: 1;
}

.wave {
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 200%;
    height: 30px;
    background: rgba(14, 165, 233, 0.12);
    border-radius: 40%;
    animation: drift 6s linear infinite;
    transform: translate3d(0, 0, 0);
}

.wave:nth-of-type(2) {
    bottom: -12px;
    background: rgba(14, 165, 233, 0.18);
    animation: drift 4s linear infinite;
    animation-delay: 1.5s;
}

/* BAY ACTION CONTROLS */
.bay-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(2, 132, 199, 0.1);
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 2;
}

.bay-controls {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-card-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.btn-add-time {
    background: rgba(2, 132, 199, 0.08);
    color: var(--color-cyan);
    border-color: rgba(2, 132, 199, 0.2);
}

.btn-add-time:hover {
    background: var(--color-cyan);
    color: white;
}

.btn-force-open {
    background: rgba(5, 150, 105, 0.08);
    color: var(--color-green);
    border-color: rgba(5, 150, 105, 0.2);
}

.btn-force-open:hover {
    background: var(--color-green);
    color: white;
}

.btn-force-close {
    background: rgba(220, 38, 38, 0.08);
    color: var(--color-red);
    border-color: rgba(220, 38, 38, 0.2);
}

.btn-force-close:hover {
    background: var(--color-red);
    color: white;
}

/* SIMULATION CONTROLS */
.global-controls {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(2, 132, 199, 0.1);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.global-controls h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 800;
}

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

/* BUTTONS */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.18);
}

.btn-danger:hover {
    background: var(--color-red);
    color: white;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: #cbd5e1;
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: #94a3b8;
}

/* SIMULATION CONTENT ROW */
.simulation-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 640px) {
    .simulation-content {
        grid-template-columns: 1fr;
    }
}

/* PHYSICAL SIGN */
.physical-sign-card {
    background: #ffffff;
    color: #0f172a;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(2, 132, 199, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 6px solid #0284c7; /* Sky blue theme border */
}

.sign-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.napas-logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0284c7;
    letter-spacing: -0.5px;
}

.napas-logo span {
    color: #ea580c; /* Orange */
}

.sign-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #1e293b;
}

.qr-container-outer {
    position: relative;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    margin-bottom: 16px;
}

.qr-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #0284c7;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
}

.qr-code-wrapper {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-svg {
    width: 100%;
    height: 100%;
}

.sign-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-tag {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ea580c;
    line-height: 1;
}

.time-tag {
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
}

.sign-hint {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 10px;
    font-weight: 500;
    max-width: 200px;
}

/* SMARTPHONE MOCKUP - LIGHT BLUE BANKING APP */
.smartphone-mockup {
    width: 100%;
    max-width: 260px;
    height: 480px;
    background: #0f172a; /* Slate 900 frame */
    border: 8px solid #334155; /* Slate 700 border */
    border-radius: 36px;
    padding: 8px;
    box-shadow: 0 20px 40px rgba(2, 132, 199, 0.15);
    margin: 0 auto;
    position: relative;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #f8fafc; /* Light phone screen background */
    border-radius: 26px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
}

.phone-header {
    height: 24px;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 600;
    background: #ffffff;
}

.notch {
    width: 80px;
    height: 14px;
    background: #334155;
    border-radius: 0 0 10px 10px;
}

.bank-app-body {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #0f172a;
}

.bank-app-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.bank-logo {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0284c7; /* Sky 600 Logo */
}

.app-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.transfer-details {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-row .lbl {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.detail-row .val {
    font-size: 0.75rem;
    color: #0f172a;
}

.font-semibold {
    font-weight: 700;
}

.font-mono {
    font-family: var(--font-mono);
}

.highlight-amount .val {
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 800;
}

.highlight-memo .val {
    color: var(--color-cyan);
    background: rgba(2, 132, 199, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(2, 132, 199, 0.18);
    display: inline-block;
    align-self: flex-start;
    font-weight: 800;
}

.alert-info {
    background: rgba(2, 132, 199, 0.05);
    border: 1px solid rgba(2, 132, 199, 0.12);
    color: #0284c7;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.65rem;
    line-height: 1.3;
}

.btn-pay {
    width: 100%;
    margin-top: auto;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-pay:hover {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.3);
    transform: translateY(-1px);
}

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

/* CONSOLE SECTION - CLEAN LIGHT THEME */
.console-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.console-tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border-right: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}

.tab-btn.active-tab {
    color: var(--color-cyan);
    background: #ffffff;
    border-bottom: 2px solid var(--color-cyan);
}

.tab-content {
    padding: 16px;
}

.tab-content.hidden {
    display: none;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-clear {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    color: var(--text-primary);
    border-color: #94a3b8;
}

.console-body {
    background: #f8fafc; /* Off-white editor panel style */
    border-radius: 8px;
    height: 180px;
    padding: 12px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #e2e8f0;
}

/* Console logs styles */
.log-line {
    display: flex;
    gap: 8px;
    line-height: 1.4;
}

.log-time {
    color: #94a3b8;
    flex-shrink: 0;
}

.log-tag {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
}

.tag-system { background: #e2e8f0; color: #475569; }
.tag-payos  { background: #dbeafe; color: #1d4ed8; }
.tag-server { background: #d1fae5; color: #047857; }
.tag-iot    { background: #e0f2fe; color: #0369a1; }
.tag-valve  { background: #ffe4e6; color: #be123c; }

.log-message {
    color: #334155;
    word-break: break-all;
}

/* ARCHITECTURE LAYOUT */
.architecture-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .architecture-container {
        grid-template-columns: 1fr;
    }
}

.text-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.text-info h3 {
    font-size: 1.1rem;
    color: var(--color-cyan);
    font-weight: 800;
    border-left: 3px solid var(--color-cyan);
    padding-left: 8px;
}

.text-info h4 {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 8px;
    font-weight: 700;
}

.text-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.text-info pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
}

.text-info code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #0369a1; /* Dark blue/cyan code text */
}

/* ANIMATIONS */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes drift {
    from { transform: rotate(0deg); }
    from { transform: rotate(360deg); }
}
