﻿/* =====================================================
   RESET
===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
    min-height: 100vh;
}

/* =====================================================
   PAGE
===================================================== */

.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* =====================================================
   HERO CARD
===================================================== */

.hero-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.hero-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.qr-box {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    background: #eef3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .qr-box i {
        font-size: 36px;
        color: #3157ff;
    }

.hero-content h1 {
    font-size: 22px;
    color: #14398b;
    margin-bottom: 4px;
}

.hero-content p {
    color: #6b7280;
    font-size: 13px;
    max-width: 500px;
}

.hero-logo img {
    max-height: 60px;
    width: auto;
}

/* =====================================================
   BUTTONS
===================================================== */

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn-start,
.btn-stop {
    border: none;
    cursor: pointer;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    transition: .3s;
}

.btn-start {
    background: #3157ff;
    color: white;
}

    .btn-start:hover {
        background: #2146e0;
    }

.btn-stop {
    background: white;
    border: 2px solid #3157ff;
    color: #3157ff;
}

    .btn-stop:hover {
        background: #3157ff;
        color: white;
    }

/* =====================================================
   KIT DETAILS
===================================================== */

.kit-details-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
    display:none;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

    .card-title i {
        color: #14398b;
        font-size: 18px;
    }

    .card-title h3 {
        font-size: 18px;
        color: #14398b;
    }

.kit-info-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.info-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
}

    .info-item label {
        display: block;
        color: #64748b;
        margin-bottom: 4px;
        font-size: 12px;
    }

    .info-item span {
        font-size: 14px;
        font-weight: 700;
    }

/* =====================================================
   STATUS BOXES
===================================================== */

.status-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.status-box {
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-icon {
    font-size: 22px;
}

.completed {
    background: #ecfdf5;
}

    .completed .status-icon {
        color: #16a34a;
    }

.pending {
    background: #fff7ed;
}

    .pending .status-icon {
        color: #ea580c;
    }

.status-box h4 {
    margin-bottom: 2px;
    font-size: 13px;
}

.status-box span {
    font-size: 20px;
    font-weight: 700;
}

/* =====================================================
   PROGRESS
===================================================== */

.progress-section {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 50px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,#3157ff,#4f72ff);
    border-radius: 50px;
}

/* =====================================================
   SCAN BUTTON
===================================================== */

.scan-bottle-btn {
    width: 100%;
    background: linear-gradient(90deg,#3157ff,#4f72ff);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 11px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .3s;
}

    .scan-bottle-btn:hover {
        transform: translateY(-2px);
    }

    .scan-bottle-btn i {
        margin-right: 10px;
    }

.help-text {
    margin-top: 10px;
    background: #eef3ff;
    color: #3157ff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
}

/* =====================================================
   SCANNER MODAL
===================================================== */

.scanner-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.scanner-container {
    text-align: center;
    color: white;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 35px;
    cursor: pointer;
}

.scanner-frame {
    width: 320px;
    height: 320px;
    border: 3px solid white;
    border-radius: 18px;
    position: relative;
    margin: auto;
}

.scanner-corners span {
    position: absolute;
    width: 35px;
    height: 35px;
    border: 4px solid #3157ff;
}

    .scanner-corners span:nth-child(1) {
        top: -3px;
        left: -3px;
        border-right: none;
        border-bottom: none;
    }

    .scanner-corners span:nth-child(2) {
        top: -3px;
        right: -3px;
        border-left: none;
        border-bottom: none;
    }

    .scanner-corners span:nth-child(3) {
        bottom: -3px;
        left: -3px;
        border-right: none;
        border-top: none;
    }

    .scanner-corners span:nth-child(4) {
        bottom: -3px;
        right: -3px;
        border-left: none;
        border-top: none;
    }

.scan-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background: #3157ff;
    animation: scan 2s infinite linear;
}

@keyframes scan {
    0% {
        top: 10%;
    }

    50% {
        top: 85%;
    }

    100% {
        top: 10%;
    }
}

.scanner-text {
    margin-top: 20px;
}

.detect-btn {
    margin-top: 25px;
    border: none;
    background: #3157ff;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
}

/* =====================================================
   OVERLAY
===================================================== */

.sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   CENTERED MODAL (was bottom sheet)
===================================================== */

.bottom-sheet {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    max-width: 95%;
    background: white;
    border-radius: 16px;
    padding: 22px 24px;
    z-index: 10000;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 20px;
    margin: 0 auto 14px;
}

.sheet-header h3 {
    margin-bottom: 14px;
    font-size: 16px;
}

.sheet-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
}

.form-group {
    margin-bottom: 12px;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        font-size: 13px;
    }

    .form-group input,
    .form-group textarea {
        width: 100%;
        border: 1px solid #d1d5db;
        border-radius: 10px;
        padding: 9px 12px;
        font-size: 13px;
    }

.sheet-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn-cancel,
.btn-save {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-cancel {
    border: 2px solid #d1d5db;
    background: white;
}

.btn-save {
    border: none;
    background: #3157ff;
    color: white;
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {

    .page-wrapper {
        padding: 15px;
    }

    .hero-card {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }

    .hero-left {
        flex-direction: column;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .kit-info-grid {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .sheet-row {
        flex-direction: column;
        gap: 10px;
    }

    .sheet-actions {
        flex-direction: column;
    }

    .scanner-frame {
        width: 260px;
        height: 260px;
    }

    .bottom-sheet {
        width: 95%;
        max-width: 95%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 18px 16px;
    }
}

@keyframes api-spin {
    to {
        transform: rotate(360deg);
    }
}