/* ไฟล์: assets/css/style.css */

/* ===== GENERAL STYLES ===== */
:root {
    --primary-color: #6f42c1;
    --primary-dark: #5a32a3;
    --secondary-color: #a991e5;
    --light-purple: #e9d8fd;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

body {
    font-family: 'Kanit', 'Prompt', sans-serif;
    background-color: #f8f9fa;
}

/* ===== LAYOUTS ===== */
.sidebar {
    background-color: var(--primary-color);
    min-height: 100vh;
    color: white;
    padding: 0;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/illustrations/sidebar_pattern.svg');
    background-position: center;
    background-size: cover;
    opacity: 0.05;
    z-index: -1;
}

.sidebar-heading {
    padding: 1.5rem 1rem;
    font-size: 1.2rem;
    background-color: var(--primary-dark);
    display: flex;
    align-items: center;
}

.sidebar-heading i {
    font-size: 1.5rem;
    margin-right: 10px;
}

.sidebar-link {
    color: white;
    transition: all 0.3s;
    position: relative;
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 3px solid var(--light-purple);
}

.sidebar-link.active {
    background-color: var(--primary-dark);
    color: white;
    border-left: 3px solid var(--light-purple);
}

.sidebar-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.content {
    padding: 25px;
    flex-grow: 1;
}

.navbar {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    color: var(--primary-color);
    font-weight: 600;
}

.page-heading {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.page-heading i {
    font-size: 1.6rem;
    margin-right: 10px;
    color: var(--primary-color);
}

/* ===== CARDS ===== */
.card {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: none;
    display: flex;
    align-items: center;
}

.card-header i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.card-body {
    padding: 1.5rem;
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-stats .card {
    padding: 0;
    overflow: hidden;
}

.dashboard-stats .card-body {
    display: flex;
    align-items: center;
    padding: 1.5rem;
}

.dashboard-stats .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.8rem;
    color: white;
}

.dashboard-stats .card-info {
    flex-grow: 1;
}

.dashboard-stats .card-title {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #6c757d;
    text-transform: uppercase;
}

.dashboard-stats .card-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #333;
}

.icon-bg-primary {
    background-color: var(--primary-color);
}

.icon-bg-success {
    background-color: var(--success-color);
}

.icon-bg-info {
    background-color: var(--info-color);
}

.icon-bg-warning {
    background-color: var(--warning-color);
}

.icon-bg-danger {
    background-color: var(--danger-color);
}

/* ===== HEALTH RECORD CARDS ===== */
.health-card {
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.health-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--primary-color);
}

.health-card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background-color: var(--light-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    transition: all 0.3s;
}

.health-card:hover .health-card-icon {
    transform: scale(1.1);
}

.health-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}

.health-card-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #333;
}

.health-card-unit {
    font-size: 0.9rem;
    color: #6c757d;
}

/* ===== TABLES ===== */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: var(--light-purple);
    color: var(--primary-dark);
    font-weight: 600;
    border-bottom: none;
    padding: 0.75rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(111, 66, 193, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(111, 66, 193, 0.1);
}

/* ===== FORMS ===== */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== USER PROFILE ===== */
.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: var(--light-purple);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

/* ===== ALERTS & BADGES ===== */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
    border-radius: 6px;
}

/* ===== MODALS ===== */
.modal-content {
    border-radius: 15px;
    border: none;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid #eee;
}

/* ===== CHARTS & GRAPHS ===== */
.chart-container {
    position: relative;
    height: 300px;
    margin: 15px auto;
}

/* ===== BMI INDICATORS ===== */
.text-underweight {
    color: var(--warning-color);
}

.text-normal {
    color: var(--success-color);
}

.text-overweight {
    color: var(--warning-color);
}

.text-obese {
    color: var(--danger-color);
}

/* ===== ANIMATIONS ===== */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        transform: translateY(20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== ICONS WITH TEXT ===== */
.icon-with-text {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.icon-with-text i {
    width: 30px;
    height: 30px;
    background-color: var(--light-purple);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 0.9rem;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
