@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #0f766e;
    --primary-light: #14b8a6;
    --primary-dark: #115e59;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
}

body {
    font-family: 'Sarabun', 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
    font-size: 0.95rem;
}

/* Form inputs focus state */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 0 0.25rem rgba(20, 184, 166, 0.2) !important;
}

/* Premium Fullscreen Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 99999;
    color: #ffffff;
    font-family: 'Sarabun', sans-serif;
}
.loading-spinner {
    width: 3.5rem;
    height: 3.5rem;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    border-top-color: var(--secondary);
    animation: spin-loader 0.8s linear infinite;
    margin-bottom: 1.25rem;
}
@keyframes spin-loader {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Premium Layout & Header (Light Theme) */
.navbar-custom {
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--secondary);
}

.brand-text {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #0f172a !important;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: #64748b;
    display: block;
}

/* Navbar Link colors for light theme */
.navbar-custom .nav-link {
    color: #475569 !important;
    font-weight: 600;
    transition: color 0.2s ease;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #0f172a !important;
}

/* Card Styling */
.card-premium {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card-premium:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header-gradient {
    background: #ffffff;
    color: var(--primary);
    border-top-left-radius: var(--radius-md) !important;
    border-top-right-radius: var(--radius-md) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

/* Buttons (Emerald, Teal, Warning, Officer) */
.btn-emerald {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700;
    transition: all 0.25s ease;
}
.btn-emerald:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35) !important;
}
.btn-emerald:active, .btn-emerald:focus {
    color: #ffffff !important;
    background: #0f766e !important;
}

.btn-outline-teal {
    color: #0f766e !important;
    border: 2px solid #0f766e !important;
    background-color: transparent !important;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-outline-teal:hover {
    background-color: #0f766e !important;
    color: #ffffff !important;
}

.btn-officer {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-officer:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.bg-teal {
    background-color: #0f766e !important;
}
.text-teal {
    color: #0f766e !important;
}

.btn-premium {
    background-color: #a7f3d0;
    color: #022c22;
    border: 1px solid #6ee7b7;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-premium:hover {
    background-color: #6ee7b7;
    color: #022c22;
    transform: translateY(-1px);
}

.btn-secondary-premium {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.4rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary-premium:hover {
    background-color: var(--primary);
    color: white;
}

/* Document List Checklist */
.checklist-item {
    background-color: #f1f5f9;
    border-left: 4px solid var(--secondary);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Custom Step Timeline (Tracking Page) */
.timeline-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 2rem 0;
    padding: 0 1rem;
}

.timeline-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #cbd5e1;
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-step-item {
    position: relative;
    z-index: 2;
    text-align: center;
    background-color: var(--bg-card);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #cbd5e1;
    color: #94a3b8;
    transition: all 0.3s ease;
    font-weight: bold;
}

.timeline-step-item.active {
    border-color: var(--primary-light);
    background-color: var(--primary);
    color: white;
    box-shadow: 0 0 12px var(--primary-light);
}

.timeline-step-item.completed {
    border-color: var(--success);
    background-color: var(--success);
    color: white;
}

.timeline-label {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.timeline-step-item.active + .timeline-label {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Detail Timeline List */
.timeline-vertical {
    border-left: 3px solid var(--primary-light);
    padding-left: 20px;
    margin-left: 10px;
    position: relative;
}

.timeline-vertical-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-vertical-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-light);
    border: 2px solid var(--bg-card);
}

.timeline-vertical-item.completed::before {
    background-color: var(--success);
}

.timeline-vertical-item.rejected::before {
    background-color: var(--danger);
}

/* Chat bubble styling */
.chat-box {
    max-height: 400px;
    overflow-y: auto;
    background-color: #f1f5f9;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    max-width: 75%;
    font-size: 0.9rem;
    position: relative;
}

.chat-bubble.applicant {
    background-color: #ffffff;
    border-top-left-radius: 2px;
    margin-right: auto;
    box-shadow: var(--shadow-sm);
}

.chat-bubble.officer {
    background-color: #dbeafe;
    border-top-right-radius: 2px;
    margin-left: auto;
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.chat-bubble.internal {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-top-right-radius: 2px;
    margin-left: auto;
    color: #92400e;
    box-shadow: var(--shadow-sm);
}

.chat-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

/* Admin Panel Styling (Light Theme Sidebar) */
.admin-sidebar {
    background-color: #f8fafc;
    color: #1e293b;
    min-height: auto;
    box-shadow: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .admin-sidebar {
        min-height: 100vh;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
    }
}

.admin-sidebar-link {
    color: #475569;
    display: block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.admin-sidebar-link:hover, .admin-sidebar-link.active {
    background-color: #e2e8f0;
    color: #0f172a;
    font-weight: 600;
}

/* PDF Preview Frame */
.pdf-preview-container {
    background-color: #475569;
    height: 600px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

/* Stat Box Dashboard (Pastel Backgrounds, Dark Text) */
.stat-box {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}
.stat-box-total { background: #e0f2fe; }
.stat-box-submitted { background: #f1f5f9; }
.stat-box-received { background: #e0f7fa; }
.stat-box-review { background: #fef3c7; }
.stat-box-approved { background: #d1fae5; }
.stat-box-rejected { background: #fee2e2; }

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
}

.stat-label {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Responsive fixes for steps */
@media (max-width: 768px) {
    .timeline-steps {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 2rem;
    }
    .timeline-steps::before {
        left: 31px;
        top: 0;
        bottom: 0;
        width: 4px;
        height: 100%;
    }
    .timeline-step-item {
        margin-bottom: 3.5rem;
    }
    .timeline-label {
        top: 10px;
        left: 70px;
        transform: none;
    }
}

/* Premium Green Theme Hero & Utilities (Light Theme) */
.hero-gradient {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f0 50%, #f4f6f5 100%);
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.text-gradient {
    background: linear-gradient(to right, #b45309, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.badge-online-service {
    background-color: rgba(6, 78, 59, 0.06);
    border: 1px solid rgba(6, 78, 59, 0.1);
    font-size: 0.8rem;
    color: var(--primary) !important;
}

.glass-premium-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: #1e293b;
}

.glass-list-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.glass-list-item:hover {
    background: #f1f5f9;
    border-color: var(--primary-light);
    transform: translateX(5px);
}

/* Submenu Bar styles */
.submenu-item {
    color: var(--primary);
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.submenu-item:hover {
    background-color: #f0fdf4;
    border-color: #dcfce7;
    transform: translateY(-2px);
    color: var(--primary-light);
}

.submenu-icon {
    font-size: 1.5rem;
    color: var(--primary);
    background-color: #f0fdf4;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.25s ease;
}

.submenu-item:hover .submenu-icon {
    background-color: var(--primary);
    color: #ffffff;
}

.submenu-text {
    font-size: 0.85rem;
    color: #334155;
}

/* Additional layout styles */
.text-teal {
    color: #0d9488;
}

.text-dark-green {
    color: var(--primary);
}

.fs-7 {
    font-size: 0.8rem !important;
}

.tracking-wider {
    letter-spacing: 0.1em;
}

.animate-spin-slow {
    animation: spin 8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-warning, .btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #022c22 !important;
}

.btn-outline-light, .btn-outline-light:active, .btn-outline-light:focus {
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    background-color: transparent !important;
}

.btn-outline-light:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* Custom width column for 5 items in bootstrap grid */
@media (min-width: 768px) {
    .col-md-2-custom {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* Graphite Creative Layout Adaptations */
.logo-vector {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    clip-path: polygon(0 0, 100% 0, 80% 100%, 0 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--secondary) !important;
    font-size: 22px;
    font-family: 'Outfit', sans-serif;
    border-left: 1px solid var(--secondary);
}

/* Redefined Card Premium with Graphite Numbering & Hover Borders */
.card-premium {
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid var(--border-color);
}

.card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--secondary) 0%, var(--primary-light) 100%);
    transition: height 0.3s ease;
}

.card-premium:hover {
    transform: translateY(-5px);
}

.card-premium:hover::before {
    height: 100%;
}

.service-number {
    font-size: 3rem;
    font-weight: 300;
    color: #cbd5e1;
    font-family: 'Courier New', monospace;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
    line-height: 1;
}

.card-premium:hover .service-number {
    color: var(--primary);
}

.service-number::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card-premium:hover .service-number::after {
    transform: scaleX(1);
}

/* Graphite angular clipped CTA buttons */
.btn-graphite-action {
    clip-path: polygon(0 0, 92% 0, 100% 100%, 0 100%);
    border-left: 2px solid var(--secondary) !important;
    border-bottom: 2px solid var(--secondary) !important;
    transition: all 0.3s ease;
}

.btn-graphite-action:hover {
    transform: translateY(-2px);
}

/* ============================================================
   RESPONSIVE LAYOUT ENHANCEMENTS FOR MOBILE & TABLETS
   ============================================================ */

/* Navbar Brand & Logo Responsive Fixes */
@media (max-width: 991.98px) {
    .navbar-brand {
        max-width: 80%;
    }
    .brand-text {
        font-size: 1rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.2;
    }
    .brand-subtitle {
        font-size: 0.65rem;
        margin-top: 2px;
    }
    .logo-vector {
        width: 48px;
        height: 48px;
        font-size: 16px;
        margin-right: 8px !important;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        max-width: 75%;
    }
    .brand-text {
        font-size: 0.82rem;
    }
    .brand-subtitle {
        font-size: 0.6rem;
    }
}

/* Image Slider / Banner Carousel Responsive height */
#infographicCarousel .carousel-item {
    min-height: 200px;
}
@media (max-width: 991.98px) {
    #infographicCarousel .carousel-item img {
        max-height: 360px !important;
    }
}
@media (max-width: 575.98px) {
    #infographicCarousel .carousel-item img {
        max-height: 240px !important;
    }
}

/* PDPA padding on mobile */
@media (max-width: 767.98px) {
    .pdpa-box {
        padding: 2rem 1.5rem !important;
    }
}

/* Table Responsive wrapper */
.table-responsive {
    margin-bottom: 1rem;
    overflow-y: hidden;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* Timeline flow responsive design spacing */
@media (max-width: 767.98px) {
    .timeline-progress-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1.5rem !important;
        padding-left: 20px !important;
    }
    .timeline-progress-bar > .position-absolute {
        display: none !important; /* Hide background bar lines on mobile vertical stacked timeline */
    }
    .timeline-progress-bar > div {
        display: flex !important;
        align-items: center !important;
        text-align: left !important;
        width: 100%;
    }
    .timeline-progress-bar > div > .rounded-circle {
        margin-right: 15px !important;
        flex-shrink: 0;
    }
    .timeline-progress-bar > div > div.small {
        margin-top: 0 !important;
        font-size: 0.85rem !important;
    }
}



