/* App agent EasyTrack - styles */

* { box-sizing: border-box; }

.btn-primary {
    background: #1E40AF;
    color: white;
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 8px 16px -4px rgba(30,64,175,0.35);
}
.btn-primary:hover:not(:disabled) { background: #1E3A8A; transform: translateY(-1px); box-shadow: 0 12px 20px -4px rgba(30,64,175,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #94A3B8; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
    background: #F1F5F9;
    color: #1E293B;
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-secondary:hover { background: #E2E8F0; }

.btn-danger {
    background: #DC2626;
    color: white;
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 16px -4px rgba(220,38,38,0.35);
}
.btn-danger:hover { background: #B91C1C; }

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.15s;
}
.input-field:focus { border-color: #1E40AF; }

.code-input {
    width: 44px;
    height: 56px;
    text-align: center;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #0F172A;
    outline: none;
    transition: all 0.15s;
}
.code-input:focus { border-color: #1E40AF; box-shadow: 0 0 0 4px rgba(30,64,175,0.15); transform: scale(1.05); }

.card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

/* Pulse animation for active shift */
.pulse-dot {
    width: 12px; height: 12px; background: #10B981; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16,185,129,0.7);
    animation: pulseRing 1.8s cubic-bezier(0.66, 0, 0, 1) infinite;
}
@keyframes pulseRing { 0%{box-shadow:0 0 0 0 rgba(16,185,129,0.7);} 70%{box-shadow:0 0 0 12px rgba(16,185,129,0);} 100%{box-shadow:0 0 0 0 rgba(16,185,129,0);} }

/* Scanner overlay */
.scanner-overlay {
    position: fixed; inset: 0; background: black; z-index: 100;
    display: flex; flex-direction: column;
}
.scanner-overlay video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: min(70vw, 320px); height: min(70vw, 320px);
    border: 3px solid white;
    border-radius: 32px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    pointer-events: none;
}
.scanner-frame::before, .scanner-frame::after,
.scanner-frame > i:first-child, .scanner-frame > i:last-child {
    content: ''; position: absolute; width: 32px; height: 32px;
    border-color: #3B82F6; border-style: solid; border-width: 0;
}
.scanner-frame::before { top:-3px; left:-3px; border-top-width:6px; border-left-width:6px; border-radius: 18px 0 0 0; }
.scanner-frame::after { top:-3px; right:-3px; border-top-width:6px; border-right-width:6px; border-radius: 0 18px 0 0; }
.scanner-frame > .c-bl { bottom:-3px; left:-3px; border-bottom-width:6px; border-left-width:6px; border-radius: 0 0 0 18px; }
.scanner-frame > .c-br { bottom:-3px; right:-3px; border-bottom-width:6px; border-right-width:6px; border-radius: 0 0 18px 0; }

.scanner-header {
    position: absolute; top: 0; left: 0; right: 0;
    padding: env(safe-area-inset-top, 12px) 16px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.6), transparent);
    color: white; display: flex; justify-content: space-between; align-items: center;
    z-index: 110;
}
.scanner-footer {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 24px 24px calc(env(safe-area-inset-bottom, 0) + 32px);
    background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
    color: white; text-align: center;
    z-index: 110;
}
.scanner-close-btn {
    width: 40px; height: 40px; background: rgba(255,255,255,0.2);
    border-radius: 50%; backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    color: white; border: none; cursor: pointer; font-size: 22px;
}

/* Active shift card glow */
.shift-active-card {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
    color: white;
    box-shadow: 0 20px 40px -12px rgba(30,64,175,0.45);
}

.toast {
    position: fixed; top: max(env(safe-area-inset-top, 0), 20px); left: 16px; right: 16px;
    padding: 14px 18px;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    z-index: 200;
    box-shadow: 0 20px 35px -10px rgba(0,0,0,0.3);
    animation: toastIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
    backdrop-filter: blur(8px);
}
.toast.success { background: linear-gradient(135deg, rgba(16,185,129,0.95), rgba(5,150,105,0.95)); }
.toast.error   { background: linear-gradient(135deg, rgba(239,68,68,0.95), rgba(220,38,38,0.95)); }
.toast.info    { background: linear-gradient(135deg, rgba(30,64,175,0.95), rgba(29,78,216,0.95)); }
.toast.warning { background: linear-gradient(135deg, rgba(245,158,11,0.95), rgba(217,119,6,0.95)); }
@keyframes toastIn { 0% {transform:translateY(-100%); opacity:0;} 100% {transform:translateY(0); opacity:1;} }

.tab-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid #E2E8F0;
    padding: 8px 0 calc(env(safe-area-inset-bottom, 0) + 8px);
    display: flex;
    z-index: 10;
}
.tab-item {
    flex: 1; padding: 8px 4px; text-align: center;
    color: #94A3B8;
    cursor: pointer;
    transition: color 0.15s;
}
.tab-item.active { color: #1E40AF; }
.tab-item svg { width: 24px; height: 24px; margin: 0 auto 2px; display: block; }
.tab-item .label { font-size: 11px; font-weight: 600; }

.spinner {
    width: 24px; height: 24px;
    border: 3px solid #E2E8F0;
    border-top-color: #1E40AF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
