/* GPS Attendance Demo - attendance_demo.css */
:root {
    --primary-bg: #f8fafc;
    --card-bg: #ffffff;
    --accent-blue: #2563eb;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --header-h: 56px;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--primary-bg);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.premium-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, .03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, .03) 0%, transparent 40%);
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.site-header__inner {
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #111;
}

.brand img {
    height: 28px;
    width: auto;
}

.header-badge {
    font-size: .8rem;
    padding: 6px 14px;
    border-radius: 99px;
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, .8);
    border: 1px solid #dbeafe;
    border-radius: 99px;
    padding: 5px 14px;
    font-size: .8rem;
    font-weight: 600;
    color: #1d4ed8;
    cursor: pointer;
    transition: all .2s;
}

.lang-toggle:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.header-section {
    padding: calc(var(--header-h) + 1.5rem) 0 1rem;
    text-align: left;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.header-section h1 {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.8rem;
    margin-bottom: .25rem;
}

.header-section .subtitle {
    font-size: .95rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 5rem;
}

/* Stat Cards */
.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .02);
    transition: transform .2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, .06);
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: transform .2s;
}

.stat-label {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.stat-normal .stat-num {
    color: var(--accent-green);
}

.stat-late .stat-num {
    color: var(--accent-yellow);
}

.stat-absent .stat-num {
    color: var(--accent-red);
}

.stat-leave .stat-num {
    color: var(--accent-purple);
}

.stat-outdoor .stat-num {
    color: var(--accent-blue);
}

/* Clean Card */
.clean-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .05);
    margin-bottom: 1rem;
    transition: all .3s;
}

.clean-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .07);
}

/* Table */
.att-table {
    background: transparent !important;
    color: var(--text-dark) !important;
}

.att-table thead th {
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .05em;
    padding: .75rem;
}

.att-table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: .85rem .75rem;
    font-size: .85rem;
}

.att-table tbody tr {
    transition: background .2s;
}

.att-table tbody tr:hover {
    background: #f8fafc;
}

.status-badge {
    padding: .3rem .75rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 600;
    display: inline-block;
}

.st-normal {
    background: #ecfdf5;
    color: #10b981;
    border: 1px solid #d1fae5;
}

.st-late {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fef3c7;
}

.st-absent {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.st-leave {
    background: #f5f3ff;
    color: #8b5cf6;
    border: 1px solid #e9d5ff;
}

.st-outdoor {
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #dbeafe;
}

/* Approval */
.approval-item {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: .75rem;
}

.approval-item .btn-approve {
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .4rem 1rem;
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
    transition: all .2s;
}

.approval-item .btn-approve:hover {
    background: #059669;
}

.approval-item .btn-reject {
    background: #fff;
    color: var(--accent-red);
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: .4rem 1rem;
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
}

/* Approval Flow Visualization */
.approval-flow {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

.af-node {
    text-align: center;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: .7rem;
    min-width: 60px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: all .3s;
}

.af-node i {
    font-size: 1rem;
    display: block;
    margin-bottom: 2px;
}

.af-done {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}

.af-pending {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #d97706;
    animation: afPulse 1.5s infinite;
}

.af-waiting {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

@keyframes afPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(217, 119, 6, .15);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(217, 119, 6, 0);
    }
}

.af-arrow {
    color: #cbd5e1;
    font-size: .7rem;
}

/* GPS Map */
.gps-map-container {
    border-radius: 12px;
    overflow: hidden;
}

.map-placeholder {
    background: linear-gradient(135deg, #e8f4f8, #d1ecf1);
    border-radius: 12px;
    height: 220px;
    position: relative;
    overflow: hidden;
}

.map-bg {
    width: 100%;
    height: 100%;
    position: relative;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0, 0, 0, .03) 40px, rgba(0, 0, 0, .03) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0, 0, 0, .03) 40px, rgba(0, 0, 0, .03) 41px);
}

.map-factory {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
}

.map-factory i {
    font-size: 1.5rem;
    color: #1e40af;
    display: block;
}

.map-factory span {
    font-size: .65rem;
    color: #1e40af;
    font-weight: 700;
    white-space: nowrap;
    background: rgba(255, 255, 255, .85);
    padding: 2px 8px;
    border-radius: 4px;
}

.geofence-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px dashed rgba(37, 99, 235, .4);
    background: rgba(37, 99, 235, .06);
    z-index: 1;
}

.map-pin {
    position: absolute;
    z-index: 4;
    text-align: center;
    animation: pinDrop .4s ease-out;
}

.map-pin i {
    font-size: 1.2rem;
    color: var(--accent-green);
}

.map-pin .pin-label {
    display: block;
    font-size: .6rem;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.pin-1 {
    top: 38%;
    left: 58%;
}

.pin-2 {
    top: 25%;
    left: 78%;
}

@keyframes pinDrop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* GPS Timeline */
.gps-timeline {
    max-height: 200px;
    overflow-y: auto;
    padding-left: 4px;
}

.gps-log-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-left: 2px solid #e2e8f0;
    margin-left: 24px;
    position: relative;
}

.gle-time {
    position: absolute;
    left: -40px;
    font-size: .65rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif;
    width: 32px;
    text-align: right;
}

.gle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    margin-top: 4px;
    flex-shrink: 0;
    margin-left: -5px;
}

.gle-info {
    font-size: .78rem;
    line-height: 1.4;
}

/* Console */
.console-box {
    background: #1e293b;
    color: #94a3b8;
    border-radius: 12px;
    padding: 1rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: .75rem;
}

/* MOBILE SIMULATOR */
.mobile-view {
    position: sticky;
    top: 5rem;
    height: fit-content;
}

.iphone-frame {
    width: 260px;
    height: 540px;
    background: #222;
    border-radius: 35px;
    border: 8px solid #333;
    padding: 8px;
    position: relative;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .1);
    margin: 0 auto;
}

.iphone-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    color: #333;
}

.notch {
    width: 130px;
    height: 20px;
    background: #222;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
}

.m-header {
    padding: 30px 16px 12px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
}

.iphone-screen>div[id^="m-step"] {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.m-content {
    flex: 1;
    padding: 12px 14px;
    overflow-y: auto;
    background: #f8fafc;
    min-height: 0;
}

.m-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .02);
}

.app-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: .82rem;
    transition: all .2s;
    cursor: pointer;
}

.app-btn-primary {
    background: #1e293b;
    color: #fff;
}

.app-btn-primary:hover {
    background: #0f172a;
}

.app-btn-outline {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.btn-disabled {
    opacity: .5;
    cursor: not-allowed !important;
    background: #94a3b8 !important;
}

.m-nav {
    padding: 6px 0;
    border-top: 1px solid #f1f5f9;
    background: #fff;
    display: flex;
    justify-content: space-around;
    font-size: .6rem;
    color: #94a3b8;
}

.m-nav div {
    text-align: center;
    cursor: pointer;
}

.m-nav .active {
    color: var(--accent-blue);
}

/* GPS Circle Animation */
.gps-circle-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gps-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-blue);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, .05);
    animation: gpsPulse 2s infinite;
    transition: all .8s;
}

.gps-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 8px rgba(37, 99, 235, .5);
    transition: all .8s;
}

.gps-range {
    position: absolute;
    bottom: -6px;
    font-size: .6rem;
    background: #fff;
    padding: 0 6px;
    color: var(--accent-blue);
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid #dbeafe;
    transition: all .8s;
}

.gps-label {
    font-size: .72rem;
    margin-top: 8px;
    font-weight: 600;
    transition: all .3s;
}

@keyframes gpsPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, .2);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(37, 99, 235, 0);
    }
}

/* Geo-fence: Out of Range */
.gps-circle.out-of-range {
    border-color: #ef4444;
    background: rgba(239, 68, 68, .08);
    animation: gpsOutPulse 2s infinite;
}

.gps-circle.out-of-range .gps-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, .5);
}

.gps-circle.out-of-range .gps-range {
    color: #ef4444;
    border-color: #fecaca;
}

@keyframes gpsOutPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, .2);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }
}

/* Geo-fence: Moving Animation */
.gps-circle.in-range-anim {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, .08);
    animation: gpsMoving .5s infinite;
}

.gps-circle.in-range-anim .gps-dot {
    background: #f59e0b;
}

@keyframes gpsMoving {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }
}

/* Calc Box */
.calc-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
}

/* GPS Verify Box */
.gps-verify-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 8px;
    color: #0369a1;
    font-size: .75rem;
}

/* Scenario Controls */
.scenario-controls {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--border-color);
    padding: .6rem 1.5rem;
    border-radius: 99px;
    z-index: 100;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .1);
}

.scenario-steps {
    display: flex;
    gap: 4px;
}

.step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    font-size: .65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s;
}

.step-dot.active {
    background: var(--accent-blue);
    color: #fff;
}

.step-dot.done {
    background: var(--accent-green);
    color: #fff;
}

@media(max-width:992px) {
    .header-section {
        text-align: center;
    }

    .mobile-view {
        position: relative;
        top: 2rem;
        margin-top: 2rem;
        width: 100%;
    }

    .scenario-controls {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 16px;
        padding: .8rem 1rem;
    }
}