:root {
    --orange: #FF8A00;
    --orange-hover: #FF9E2B;
    --blue: #7DD3FC;
    --gray-dark: #374151;
    --gray-medium: #6B7280;
    --gray-light: #D1D5DB;
    --white: #FFFFFF;
    --card-bg: #F8FAFC;
    --body-bg: #F1F5F9;
    --border-color: #E5E7EB;
    --success: #02cf8b;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 200ms ease-in-out;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
    .admin-user{
        font-weight: 600;
        padding: 2rem;
        color: var(--white);
    }
    
    #admin-user {
        color: orange;
    }
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    color: var(--gray-dark);
    line-height: 1.6;
    font-size: 16px;
}
.imagebg{
  /* atur ‘transparansi’ dengan alpha di rgba() */
  background-image:
    linear-gradient(rgba(255, 220, 125, 0.541), rgb(255, 220, 125, 0.541)), /* overlay */
    url('/1.png');                                   /* gambar */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.imagebg2{
  /* atur ‘transparansi’ dengan alpha di rgba() */
  background-image:
    linear-gradient(rgba(255, 220, 125, 0.541), rgb(255, 255, 255)), /* overlay */
    url('/2.png');                                   /* gambar */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 600;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1rem; }
a { color: var(--orange); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--orange-hover); }

/* --- Header & Nav --- */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--gray-dark); }
.logo img { height: 32px; }
.main-nav ul { list-style: none; display: flex; gap: 1.5rem; }
.nav-link { color: var(--gray-medium); font-weight: 500; padding: 0.5rem 0; border-bottom: 2px solid transparent; }
.nav-link:hover { color: var(--gray-dark); }
.nav-link.active { color: var(--orange); border-bottom-color: var(--orange); }
.header-actions { display: flex; align-items: center; gap: 1rem; }


    .footer .main-footer {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        padding: 1rem 9%;
    }
    
    .main-footer {
        background-color: rgb(218, 79, 15);
        color: var(--white);
        text-align: center;
        font-size: 1rem;
        width: 100%;
        position: relative;
        bottom: 0;
        left: 0;
        z-index: 90;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        padding: 1rem 9%;
    }

/* Mobile Navigation Toggle - Hamburger Menu */


.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-dark);
    padding: 0.5rem;
    z-index: 100;
    transition: transform 0.3s ease;
}

.mobile-nav-toggle:hover {
    color: var(--orange);
}

.mobile-nav-toggle.active {
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
    .page-header{
        flex-direction: column;
        gap:12px;
    }
    .page-header h1{
        text-align: center;
        font-size: 1.5rem;
        margin-bottom: 0;
        gap: 1rem;
    }
    .page-header .search-box{
        position: relative;
        display: block;
        flex-direction: column;
        padding: 1rem;
        text-align: center;
        align-items: center;
        
    
    }
    .filters{
    position: relative;
    min-height: 48px;
    }

    .search-box .search-btn{
        position: absolute;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
    }
    #sort-select{
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    top: 0;                 /* atur kalau mau lebih turun: mis. top: 4px; */
    /* gaya opsional biar cakep */
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding: 10px 40px 10px 12px;
    border: 1px solid #e5e7eb; border-radius: 12px; background: #fff
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%236B7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>')
        no-repeat right 12px center;
    background-size: 14px 14px;
    min-width: 180px;
    cursor: pointer;
    }
    #sort-select:focus{ outline:2px solid var(--orange, #fcf37d); }
    .grid-container {
        padding: 10px;
    }


    /* / Page profile/ */
    .profile-title{
        text-align: center;
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    #logout-btn{
        padding-top: 2rem;
        display: block;
        margin: 0 auto;
        padding: 0.75rem 1.5rem;
        border-radius: var(--radius-sm);
        border: 1px solid transparent;
        font-weight: 600;
        background-color: var(--error);
        color: var(--white);
        cursor: pointer;
        transition: var(--transition);
    }

    /* page info */
    .konsel-title{
        text-align: center;
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    /* Responsif untuk halaman konseling */
    @media (max-width: 768px) {

        .tabs {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 8px;
            margin-bottom: 15px;
        }
        
        .tab-link {
            font-size: 14px;
            padding: 8px 12px;
            flex: 0 0 auto;
            white-space: nowrap;
            margin: 0 2px;
        }
        
        #articles-grid {
            grid-template-columns: 1fr;
            padding: 0;
        }
        
        .konseling main.container {
            padding: 15px 10px;
        }
        
        .konseling h1 {
            font-size: 1.5rem;
            margin-bottom: 15px;
            text-align: center;
        }
        
        .modal-content {
            width: 95%;
            margin: 10% auto;
            padding: 15px;
        }
    }
    
    .main-nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 1rem;
        box-shadow: var(--shadow);
        z-index: 99;
        animation: slideDown 0.3s ease-in-out;
    }
    .main-nav.show {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 0.8rem;
    }
    .nav-link {
        display: block;
        padding: 0.8rem;
        border-radius: var(--radius-sm);
        border-bottom: none;
    }
    .nav-link:hover {
        background-color: var(--body-bg);
    }
    .nav-link.active {
        background-color: rgba(255, 138, 0, 0.1);
        color: var(--orange);
        border-bottom: none;
    }
    .header-actions {
        gap: 0.5rem;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.btn-primary { background-color: var(--orange); color: var(--white); }
.btn-primary:hover { background-color: var(--orange-hover); }
.btn-danger { background-color: var(--error); color: var(--white); }
.icon-btn { background: none; border: none; color: var(--gray-medium); cursor: pointer; padding: 0.5rem; }
.icon-btn:hover { color: var(--gray-dark); }

/* --- Cards --- */
.card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.input, .select, textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}
textarea { resize: vertical; }
.input:focus, .select:focus, textarea:focus, input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.2);
}
.form-group-inline { display: flex; align-items: center; justify-content: space-between; }

/* --- Components --- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background-color: var(--blue);
    color: var(--gray-dark);
}
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.tab-link {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-medium);
    border-bottom: 3px solid transparent;
    transform: translateY(1px);
}
.tab-link.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    color: var(--white);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s forwards;
}
.toast.success { background-color: var(--success); }
.toast.error { background-color: var(--error); }
@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}

/* --- Skeleton Loader --- */
.skeleton {
    background-color: #e0e0e0;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}
.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    to { left: 150%; }
}

/* --- Page Specific --- */
.section { padding: 4rem 0; }
.section-title { text-align: center; margin-bottom: 3rem; }
.hero {
    background: linear-gradient(45deg, var(--orange), var(--blue));
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
}

/* Responsive adjustments for user pages */
@media (max-width: 768px) {
    .section { padding: 2rem 0; }
    .section-title { margin-bottom: 1.5rem; font-size: 1.5rem; }
    .hero {
        padding: 3rem 0;
    }
    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .notification-banner {
        padding: 1rem;
    }
    .main-footer {
        background-color: rgb(218, 79, 15);
        color: var(--white);
        padding: 1.5rem 0;
        text-align: center;
        font-size: 0.9rem;
    }
}
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}
.auth-card .logo { justify-content: center; margin-bottom: 1.5rem; }
.auth-links { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }

/* Material Card */
.material-card {
    display: flex;
    flex-direction: column;
}
.material-card .preview {
    height: 150px;
    background-color: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius) var(--radius) 0 0;
}
.material-card .preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: 100%;
}
.material-card .card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.material-card h4 { margin-top: 0; }
.material-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--gray-medium);
    margin-bottom: 0.5rem;
}
.material-card .actions {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    gap: 0.5rem;
}
.material-card .actions .btn { flex: 1; }

/* Responsive adjustments for cards */
@media (max-width: 768px) {
    .material-card .preview {
        height: 120px;
    }
    .material-card .card-content {
        padding: 0.75rem;
    }
    .material-card h4 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    .material-card .actions {
        padding-top: 0.75rem;
    }
    .material-card .actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Article Card */
.article-card {
    display: flex;
    flex-direction: column;
}
.article-card .cover {
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius) var(--radius) 0 0;
}
.article-card .card-content { padding: 1rem; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 90%;
    width: 700px;
    position: relative;
    animation: fadeIn 0.3s;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--gray-medium);
    font-size: 2rem;
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 60px; height: 40px; }
.toggle-switch-checkbox { opacity: 0; width: 0; height: 0; }
.toggle-switch-label { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 40px; }
.toggle-switch-label:before { position: absolute; content: ""; height: 25px; width: 25px; left: 2.5px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
.toggle-switch-checkbox:checked + .toggle-switch-label { background-color: var(--orange); }
.toggle-switch-checkbox:checked + .toggle-switch-label:before { transform: translateX(30px); }

/* --- Admin Panel --- */
.admin-body { display: flex; }
.admin-sidebar {
    width: 250px;
    background-color: var(--gray-dark);
    color: var(--white);
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}
.admin-sidebar .logo { margin-bottom: 2rem; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 0.5rem; flex-grow: 1; }
.admin-sidebar nav a {
    color: var(--gray-light);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-sidebar nav a:hover { background-color: #4B5563; }
.admin-sidebar nav a.active { background-color: var(--orange); color: var(--white); }
.admin-main {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 2rem;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.table-container {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th { font-weight: 600; }
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--orange);
}

/* Admin Filters & Pagination */
.admin-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.admin-filters .search-box {
    display: flex;
    gap: 0.5rem;
    flex-grow: 1;
    max-width: 300px;
}
.admin-filters select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}
.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.admin-pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.admin-pagination button.active {
    background-color: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}
.admin-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; /* Simple hide for now, can be replaced with hamburger menu */ }
    h1 { font-size: 2rem; }
    .section { padding: 2rem 0; }
    .hero { padding: 4rem 0; }
    .admin-body { flex-direction: column; }
    .admin-sidebar { position: relative; width: 100%; height: auto; }
    .admin-main { margin-left: 0; width: 100%; }
    .admin-filters { flex-direction: column; align-items: stretch; }
    .admin-filters .search-box { max-width: 100%; }
}
.consult-options .card {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.container section  {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 2rem;
}

#logout-btn{
    padding-top: 2rem;
    display: block;
    margin: 0 auto;
    padding: 1rem 4rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    background-color: var(--error);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}
