/* ========================================================
   Check Chick - Core CSS
   ======================================================== */

body {
    background-color: var(--cc-bg);
    color: var(--cc-text);
    font-family: var(--cc-font-family);
    font-size: var(--cc-font-base);
    line-height: 1.7; /* อ่านง่ายสำหรับผู้สูงอายุ */
}

/* Navbar */
.cc-navbar {
    background-color: var(--cc-primary);
    box-shadow: 0 2px 10px rgba(140, 0, 255, 0.1);
}
.cc-navbar .navbar-brand, .cc-navbar .nav-link {
    color: #fff !important;
}
.cc-navbar .nav-link:hover {
    color: var(--cc-secondary) !important;
}

/* Buttons พื้นที่แตะกว้าง ≥ 48px ตามมาตรฐาน WCAG */
.cc-btn {
    min-height: 48px;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary, .cc-btn-primary {
    background-color: var(--cc-primary);
    border-color: var(--cc-primary);
    color: #fff;
}
.btn-primary:hover, .cc-btn-primary:hover, .cc-btn-success:hover {
    background-color: #7B68EE; /* Darker primary */
    border-color: #7B68EE;
}

.cc-btn-secondary {
    background-color: var(--cc-secondary);
    border-color: var(--cc-secondary);
    color: #000;
}
.cc-btn-success {
    background-color: #228B22;
    border-color: #228B22;
    color: #ffffff;
}

/* Forms */
.form-control, .form-select {
    min-height: 48px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    font-size: var(--cc-font-base);
}
.form-control:focus, .form-select:focus {
    border-color: var(--cc-primary);
    box-shadow: 0 0 0 0.25rem rgba(178, 34, 34, 0.25);
}
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Cards */
.cc-card {
    background-color: rgb(230, 230, 230);
    background: var(--cc-surface);
    border-radius: var(--cc-radius, 14px);
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
}
.cc-card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 16px 20px;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Bottom Navigation (Mobile) */
.cc-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1030;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
.cc-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--cc-muted, #6c757d);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 5px;
}
.cc-bottom-nav .nav-item i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}
.cc-bottom-nav .nav-item.active {
    color: var(--cc-primary);
    font-weight: bold;
}
.cc-bottom-nav .scan-btn {
    position: relative;
    top: -20px;
}
.scan-circle {
    width: 60px;
    height: 60px;
    background: var(--cc-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 10px rgba(178, 34, 34, 0.4);
    border: 4px solid #fff;
}
.scan-circle i {
    font-size: 1.8rem;
    margin: 0;
}

/* Loading Overlay */
#cc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.text-shadow { text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }

/* Badges for COI */
.cc-badge {
    padding: 6px 12px;
    border-radius: 50rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.badge,
.text-truncate {
    line-height: 1.4 !important;
    padding-top: 0.35em;
    padding-bottom: 0.35em;
}
.cc-risk-low { background-color: #E8F5E9; color: var(--cc-success); border: 1px solid var(--cc-success); }
.cc-risk-medium { background-color: #FFFDE7; color: var(--cc-warning); border: 1px solid var(--cc-warning); }
.cc-risk-high { background-color: #FFF3E0; color: var(--cc-orange); border: 1px solid var(--cc-orange); }
.cc-risk-critical { background-color: #FFEBEE; color: var(--cc-danger); border: 1px solid var(--cc-danger); }
