/* =========================================================
   ULT POLTESA - MODERN DESIGN SYSTEM
   Professional UI Framework untuk Aplikasi Layanan Terpadu
   ========================================================= */

/* === VARIABLES === */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #e8f0fe;
    --secondary: #6c757d;
    --success: #198754;
    --success-light: #d1fae5;
    --warning: #ffc107;
    --warning-light: #fef3c7;
    --danger: #dc3545;
    --danger-light: #fee2e2;
    --info: #0dcaf0;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
    --sidebar-width: 280px;
}

/* === BASE === */
* { box-sizing: border-box; }
body {
    font-family: var(--font-family);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === MODERN SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.display-6 { font-size: 1.75rem; font-weight: 700; }
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

/* === SIDEBAR REVAMP === */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    background: linear-gradient(180deg, #0f172a 0%, #1a2332 100%);
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.sidebar-brand h6 {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.sidebar-brand small {
    color: rgba(255,255,255,0.4);
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.nav-sidebar { padding: 16px 12px; }
.nav-sidebar-section {
    color: rgba(255,255,255,0.25);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 16px 8px;
}
.nav-link-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 2px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}
.nav-link-sidebar:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.nav-link-sidebar.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}
.nav-link-sidebar i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}
.nav-link-sidebar .badge {
    margin-left: auto;
    font-size: 0.6rem;
    padding: 3px 8px;
}

/* === TOP HEADER === */
.top-header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.top-header-brand {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 0.5px;
}

/* === CONTENT === */
.content-wrapper {
    margin-left: 0;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}
@media (min-width: 992px) {
    .content-wrapper.dashboard-layout {
        margin-left: var(--sidebar-width);
    }
}
.content-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* === PAGE HEADER === */
.page-header {
    margin-bottom: 24px;
}
.page-header h3 {
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
    font-size: 1.5rem;
}
.page-header p {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin: 4px 0 0;
}

/* === STAT CARDS === */
.stat-card {
    border: none;
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-card h2 {
    font-weight: 800;
    margin: 8px 0 2px;
    letter-spacing: -0.03em;
}
.stat-card .stat-label {
    color: rgba(255,255,255,0.75);
    font-size: 0.8rem;
    font-weight: 500;
}

/* === CARDS === */
.card-modern {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
    background: var(--white);
}
.card-modern:hover {
    box-shadow: var(--shadow-md);
}
.card-modern .card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 20px 24px;
    font-weight: 700;
}
.card-modern .card-body {
    padding: 24px;
}

/* === TABLES === */
.table-modern {
    margin: 0;
}
.table-modern thead th {
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    border-bottom: 2px solid var(--gray-100);
}
.table-modern tbody td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
}
.table-modern tbody tr {
    transition: background 0.15s ease;
}
.table-modern tbody tr:hover {
    background: var(--gray-50);
}
.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* === BADGES === */
.badge-modern {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: var(--radius-full);
}

/* === FORM STYLES === */
.form-control-modern {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: auto;
}
.form-control-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}
.form-control-modern-lg {
    padding: 16px 20px;
    font-size: 1rem;
}
.form-label-modern {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}
.form-select-modern {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.9rem;
    height: auto;
}

/* === BUTTONS === */
.btn-modern {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 10px 24px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    border: none;
}
.btn-modern-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}
.btn-modern-lg {
    padding: 14px 32px;
    font-size: 1rem;
}
.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-modern-primary {
    background: var(--primary);
    color: #fff;
}
.btn-modern-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-modern-success { background: var(--success); color: #fff; }
.btn-modern-success:hover { background: #157347; color: #fff; }
.btn-modern-danger { background: var(--danger); color: #fff; }
.btn-modern-danger:hover { background: #b91c1c; color: #fff; }
.btn-modern-warning { background: var(--warning); color: var(--gray-900); }
.btn-modern-warning:hover { background: #e6a700; color: var(--gray-900); }
.btn-modern-light { background: var(--gray-100); color: var(--gray-700); }
.btn-modern-light:hover { background: var(--gray-200); color: var(--gray-800); }
.btn-modern-outline {
    background: transparent;
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
}
.btn-modern-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.btn-modern-ghost {
    background: transparent;
    color: var(--gray-500);
}
.btn-modern-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* === ACTION BUTTONS (icon circles) === */
.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    background: var(--gray-100);
    color: var(--gray-500);
}
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.action-btn-edit:hover { background: var(--warning-light); color: #d97706; }
.action-btn-delete:hover { background: var(--danger-light); color: var(--danger); }
.action-btn-view:hover { background: var(--primary-light); color: var(--primary); }

/* === MODALS === */
.modal-modern .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}
.modal-modern .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}
.modal-modern .modal-header h5 {
    font-weight: 700;
}
.modal-modern .modal-body {
    padding: 24px;
}
.modal-modern .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* === NAVIGATION PILLS === */
.nav-pills-modern {
    background: var(--white);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
}
.nav-pills-modern .nav-link {
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 10px 20px;
    color: var(--gray-500);
    transition: all 0.2s ease;
}
.nav-pills-modern .nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}
.nav-pills-modern .nav-link:hover:not(.active) {
    background: var(--gray-50);
    color: var(--gray-700);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}
.empty-state .empty-icon {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}
.empty-state h5 {
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--gray-400);
    font-size: 0.85rem;
    max-width: 400px;
    margin: 0 auto;
}

/* === CONTAINER LEBIH LUAS untuk layar lebar (≥1400px) === */
@media (min-width: 1400px) {
    .container {
        max-width: 1480px;
    }
}

/* =========================================================
   RESPONSIVE PUBLIC PAGES (Beranda & Detail Layanan)
   Styles for landing page and public service detail page
   ========================================================= */

/* --- Hero Section --- */
.hero-section {
    min-height: 300px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-section h1 {
    font-size: clamp(1.4rem, 4vw, 2.8rem);
    line-height: 1.2;
}
.hero-section p {
    font-size: clamp(0.85rem, 2vw, 1.15rem);
}
@media (max-width: 767.98px) {
    .hero-section {
        min-height: 220px;
    }
    .hero-section .bg-dark {
        padding: 32px 20px;
    }
}
@media (max-width: 575.98px) {
    .hero-section {
        min-height: 180px;
    }
    .hero-section .bg-dark {
        padding: 24px 16px;
    }
}

/* --- Banner CTA (Buat Permohonan) --- */
.cta-banner {
    padding: 16px 0;
}
.cta-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
@media (max-width: 575.98px) {
    .cta-banner .container {
        flex-direction: column;
        text-align: center;
    }
    .cta-banner h4 {
        font-size: 1.1rem;
    }
    .cta-banner p {
        font-size: 0.8rem !important;
    }
    .cta-banner .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* --- Services Grid (JENIS LAYANAN) --- */
@media (max-width: 767.98px) {
    .services-col {
        border-right: none !important;
        padding-right: 0 !important;
    }
    .services-col .row > .col-md-6 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .services-col .row > .col-md-6 a {
        padding: 8px 12px;
        background: var(--gray-50);
        border-radius: 10px;
        transition: all 0.15s ease;
    }
    .services-col .row > .col-md-6 a:active {
        background: var(--gray-200);
    }
}

/* --- Survey Section mobile --- */
@media (max-width: 767.98px) {
    .rating-box {
        margin-top: 20px;
        padding: 0 !important;
    }
    .rating-box textarea {
        min-height: 80px;
    }
}

/* --- Pagination Dots --- */
@media (max-width: 575.98px) {
    .page-indicator {
        display: none;
    }
}

/* --- Detail Layanan Page --- */
.detail-layanan-title {
    font-size: clamp(1.1rem, 3vw, 1.75rem);
    border-bottom: 3px solid #ffc107;
    padding-bottom: 10px;
    display: inline-block;
}
@media (max-width: 767.98px) {
    .detail-layanan-wrapper {
        min-height: 50vh;
    }
    .detail-layanan-wrapper .accordion-button {
        font-size: 0.85rem;
        padding: 14px 16px;
    }
    .detail-layanan-wrapper .accordion-body {
        padding: 14px 16px;
        font-size: 0.85rem;
    }
    .detail-layanan-wrapper .accordion-body ul,
    .detail-layanan-wrapper .accordion-body ol {
        padding-left: 18px;
    }
    .detail-layanan-wrapper .accordion-body li {
        margin-bottom: 8px;
    }
}
@media (max-width: 575.98px) {
    .detail-layanan-wrapper {
        margin-top: 16px !important;
        margin-bottom: 16px !important;
    }
    .detail-layanan-wrapper .btn-warning {
        width: 100%;
        margin-bottom: 8px;
    }
    .detail-layanan-wrapper .btn-link {
        display: block;
        text-align: center;
        margin-left: 0 !important;
        width: 100%;
    }
}

/* --- Footer mobile improvements --- */
@media (max-width: 767.98px) {
    .footer-main {
        padding-top: 40px;
    }
    .footer-main h5,
    .footer-main .footer-title {
        font-size: 0.9rem;
        margin-bottom: 14px;
    }
    .footer-main .row > div {
        margin-bottom: 24px;
    }
    .footer-main .row > div:last-child {
        margin-bottom: 0;
    }
    .footer-main .contact-info p {
        font-size: 0.8rem;
        justify-content: center;
        text-align: center;
    }
    .footer-main .footer-link-list {
        text-align: center;
    }
    .footer-bottom .row > div {
        text-align: center !important;
    }
    .footer-bottom .social-links {
        justify-content: center;
        margin-top: 12px;
    }
    .footer-bottom .social-links a:first-child {
        margin-left: 0;
    }
    .map-container iframe {
        height: 180px;
    }
}

/* === FOOTER REVAMP === */
.footer-main {
    background: var(--gray-900);
    color: rgba(255,255,255,0.7);
    padding: 40px 0 0;
    position: relative;
}
.footer-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--success), var(--warning));
}
.footer-main h5 {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}
.footer-main a:not(.btn) {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.85rem;
}
.footer-main a:not(.btn):hover {
    color: #fff;
}
.footer-main .footer-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-main .footer-link-list li {
    margin-bottom: 10px;
}
.footer-main .contact-info p {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}
.footer-main .contact-info i {
    color: var(--primary);
    font-size: 1rem;
    margin-top: 3px;
    flex-shrink: 0;
}
.footer-bottom {
    background: rgba(0,0,0,0.3);
    padding: 16px 0;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-bottom p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    transition: all 0.2s ease;
    margin-left: 8px;
}
.social-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* === BACK TO TOP === */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gray-800);
    color: #fff;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 2000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}
#backToTop:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.3);
}

/* === ANIMATIONS === */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}
.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}
.animate-slide-down {
    animation: slideDown 0.3s ease-out;
}
.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* === DASHBOARD QUICK LINKS === */
.quick-link-card {
    border: none;
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}
.quick-link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: height 0.3s ease;
}
.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.quick-link-card:hover::before {
    height: 100%;
    opacity: 0.1;
}
.quick-link-card h5 {
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}
.quick-link-card p {
    opacity: 0.8;
    font-size: 0.85rem;
    margin: 0;
    position: relative;
}

/* === SEARCH BAR === */
.search-bar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    padding: 4px 4px 4px 20px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}
.search-bar input {
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
}
.search-bar button {
    border-radius: var(--radius-full);
    padding: 8px 20px;
}

/* === RESPONSIVE === */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .content-container {
        padding: 16px;
    }
    .page-header h3 {
        font-size: 1.25rem;
    }
}
@media (max-width: 767.98px) {
    .content-container {
        padding: 12px;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-card h2 {
        font-size: 1.5rem;
    }
    .table-modern thead {
        display: none;
    }
    .table-modern tbody td {
        display: block;
        padding: 10px 16px;
        border: none;
    }
    .table-modern tbody tr {
        display: block;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        padding: 8px;
        background: var(--white);
    }
    .table-modern tbody td:before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.7rem;
        color: var(--gray-400);
        text-transform: uppercase;
        display: block;
        margin-bottom: 4px;
    }
    .nav-pills-modern {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .nav-pills-modern .nav-link {
        white-space: nowrap;
        font-size: 0.75rem;
        padding: 8px 14px;
    }
}
