/* ================== RESET & BASE ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Ini adalah fungsi gulir halus bawaan CSS */
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    padding-top: 90px;
}

/* ================== HEADER ================== */
.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    transition: all 0.3s ease;
}

.header.shrink {
    padding: 0.5rem 0;
    background: linear-gradient(135deg, #1a252f, #2980b9);
}

.header.shrink .logo {
    width: 40px;
    padding-top: 5px;
}

.header.shrink .site-title {
    font-size: 20px;
}

.header.shrink .tagline {
    font-size: 12px;
}

.header.shrink .nav-menu a {
    font-size: 14px;
}

.header-top {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 50px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    flex-shrink: 0;
    padding-top: 10px;
    transition: all 0.3s ease;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
    transition: all 0.3s ease;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    opacity: 0.8;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ================== HERO SECTION ================== */
.hero-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-content h1 {
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.hero-content p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.8;
}

.cta-button {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-visual img {
    width: 100%;
    height: auto;
    max-width: 600px;
}

.stats-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    position: relative;
}

.stats-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* ================== STATS GRID ================== */
.stats-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: -50px;
    position: relative;
    z-index: 2;
}

.stat-item {
    background: white;
    padding: 30px 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* ================== SERVICES SECTION ================== */
.services-section {
    padding: 80px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 50px;
}

.services-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.service-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s;
    border-top: 4px solid #3498db;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
}

.service-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.service-card p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.service-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* ================== PROFIL SECTION ================== */
.profil-section {
    padding: 80px 20px;
    background: #f8f9fa;
}

.profil-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.profil-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    text-align: left;
    display: flex;
    flex-direction: column;
    border-top: 4px solid #3498db;
    min-height: 400px;
    height: auto; /* Ubah dari max-height menjadi height auto */
}

.profil-box .org-chart {
    flex: 1;
}

.profil-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.profil-box h3 {
    color: #3498db;
    font-size: 20px;
    margin-bottom: 15px;
}

.profil-box p,
.profil-box ul {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    text-align: left;
}

.profil-box ul {
    padding-left: 20px;
    list-style: disc;
}

.profil-box img {
    margin-top: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

/* ================== NEWS SECTION ================== */
.news-section {
    padding: 80px 0;
    background: white;
}

.news-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.news-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-content {
    padding: 25px;
}

.news-date {
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
}

.news-title {
    color: #2c3e50;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ================== CAROUSEL ================== */
.carousel-section {
    padding: 40px 0;
    background-color: #f8f9fa;
}

.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.carousel-slide {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.carousel-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
}

.carousel-caption h3 {
    margin: 0 0 5px;
    font-size: 24px;
}

.carousel-caption p {
    margin: 0;
    font-size: 16px;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 24px;
    z-index: 100;
    transition: background 0.3s;
    border-radius: 50%;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

.carousel-dots-container {
    text-align: center;
    margin-top: 20px;
}

.carousel-dot {
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dot.active {
    background-color: #3498db;
}

/* ================== ORGANIZATIONAL CHART ================== */
.org-chart {
    padding: 20px;
    flex: 1;
    overflow-x: auto;
    overflow-y: visible;
}

.org-chart ul {
    position: relative;
    padding-left: 0;
    margin: 0;
    padding-top: 10px;
    padding-bottom: 10px;
}

.org-chart li {
    list-style: none;
    margin: 15px 0;
    position: relative;
    padding-left: 0;
}

/* Garis vertikal */
.org-chart ul li::before {
    content: "";
    position: absolute;
    left: -25px;
    top: 0;
    border-left: 2px solid #d0e3f0;
    width: 0;
    height: 100%;
}

/* Garis horizontal */
.org-chart ul li::after {
    content: "";
    position: absolute;
    left: -25px;
    top: 22px;
    border-top: 2px solid #d0e3f0;
    width: 25px;
    height: 0;
}

/* Hapus garis untuk level pertama */
.org-chart > ul > li::before {
    border-left: none !important;
}

.org-chart > ul > li::after {
    border-top: none;
}

/* Penyesuaian garis untuk child terakhir */
.org-chart ul li:last-child::before {
    height: 22px;
}

/* Indentasi untuk child */
.org-chart li ul {
    padding-left: 35px;
    position: relative;
}

/* Node Box - Simple & Elegant */
.node-box {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e1ecf4;
    border-left: 3px solid #3498db;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.08);
    font-size: 14px;
    max-width: 280px;
    min-width: 200px;
    flex-direction: row;
    gap: 12px;
    transition: all 0.2s ease;
}

.node-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    border-left-color: #2980b9;
}

/* Icon styling - Simple */
.node-box i {
    color: #3498db;
    flex-shrink: 0;
    font-size: 18px;
}

.node-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 3px;
}

.node-content .jabatan {
    font-weight: 600;
    color: #1b1b1c;
    margin-bottom: 0;
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 13px;
}

.node-content .nama {
    color: #3498db;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    word-wrap: break-word;
}

/* Styling khusus untuk level kepala (tetap biru) */
.org-chart > ul > li .node-box {
    border-left-width: 4px;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.12);
}

.org-chart > ul > li .node-box .node-content .jabatan {
    color: #494e51;
    font-weight: 700;
}

/* ================== FOOTER ================== */
.footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.contact-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.6;
}

/* ================== LOGIN PAGE ================== */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    margin-bottom: 15px;
}

.login-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    margin-right: 8px;
}

.forgot-password,
.register-link {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-password:hover,
.register-link:hover {
    color: #2c3e50;
    text-decoration: underline;
}

.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.login-button:hover {
    background: linear-gradient(135deg, #2980b9, #2c3e50);
    transform: translateY(-2px);
}

.login-footer {
    margin-top: 25px;
}

.login-footer p {
    color: #666;
    font-size: 14px;
}

/* ================== ADMIN DASHBOARD LAYOUT ================== */
body.admin-dashboard {
    background-color: #f0f2f5;
    padding-top: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    cursor: pointer;
    text-align: center;
}

.sidebar-header .logo img {
    width: 50px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-header .site-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-header .tagline {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    position: relative;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar-nav a:hover {
    background-color: #34495e;
    color: #ffffff;
}

.sidebar-nav a i {
    margin-right: 12px;
    font-size: 1rem;
}

.sidebar-nav li.active > a {
    background-color: #34495e;
    color: #ffffff;
    font-weight: bold;
}

/* Dropdown Menu */
.sidebar-nav .dropdown .submenu {
    list-style: none;
    padding: 0;
    background-color: #34495e;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    max-height: 0;
}

.sidebar-nav .dropdown.active .submenu {
    max-height: 500px;
}

.sidebar-nav .dropdown-toggle::after {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar-nav .dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
}

.sidebar-nav .submenu li a {
    padding-left: 3rem;
    font-size: 0.9rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    margin-top: auto;
}

.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;

    /* UBAH BAGIAN INI */
    width: auto; /* Ubah dari 100% menjadi auto agar lebar mengikuti teks */
    padding: 0.5rem 1.5rem; /* Kurangi padding atas-bawah agar tidak terlalu tebal */

    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;

    /* Tambahkan margin auto jika ingin tombol di tengah container */
    margin: 0 auto;
}

.logout-button:hover {
    background-color: #c0392b;
}

.logout-button i {
    margin-right: 8px;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 30px 20px 20px 20px;
    flex-grow: 1;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
    width: 100%;
}

/* Hamburger Button for Dashboard */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ================== DASHBOARD COMPONENTS ================== */
.dashboard-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 30px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    position: relative;
    display: flex;
    align-items: center;
}

.dashboard-title::before {
    content: "";
    width: 4px;
    height: 40px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    margin-right: 15px;
    border-radius: 2px;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stats-cards .stat-item {
    background: linear-gradient(135deg, white, #f8f9fa);
    border-left: 4px solid #3498db;
    position: relative;
    overflow: hidden;
}

.stats-cards .stat-item::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db20, #2980b920);
    border-radius: 50%;
    transform: translate(20px, -20px);
}

.stats-cards .stat-item:nth-child(2) {
    border-left-color: #27ae60;
}

.stats-cards .stat-item:nth-child(2)::before {
    background: linear-gradient(135deg, #27ae6020, #2ecc7120);
}

.stats-cards .stat-item:nth-child(3) {
    border-left-color: #e74c3c;
}

.stats-cards .stat-item:nth-child(3)::before {
    background: linear-gradient(135deg, #e74c3c20, #c0392b20);
}

.stats-cards .stat-item:nth-child(4) {
    border-left-color: #f39c12;
}

.stats-cards .stat-item:nth-child(4)::before {
    background: linear-gradient(135deg, #f39c1220, #e67e2220);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.main-widgets,
.side-widgets {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Widget Card */
.widget-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.widget-card h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Activity List */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding-left: 10px;
    margin-left: -10px;
    margin-right: -10px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    margin-right: 15px;
    flex-shrink: 0;
}

.activity-details h4 {
    color: #2c3e50;
    font-size: 16px;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.activity-details p {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* ================== FORM COMPONENTS ================== */
.form-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

.form-actions .btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.form-actions .btn-primary {
    background-color: #3498db;
    color: white;
}

.form-actions .btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.form-actions .btn-secondary {
    background-color: #ecf0f1;
    color: #777;
}

.form-actions .btn-secondary:hover {
    background-color: #dfe6e9;
    transform: translateY(-2px);
}

/* ================== ALERTS ================== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fcebea;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background: #e6ffed;
    border: 1px solid #b2f5ea;
    color: #155724;
}

.alert ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.alert ul li {
    margin-bottom: 6px;
    font-size: 14px;
}

/* ================== RESPONSIVE DESIGN ================== */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    /* Header Mobile */
    .header {
        padding: 0.5rem 0;
        background: linear-gradient(135deg, #1a252f, #2980b9);
    }

    .logo {
        width: 40px;
        padding-top: 5px;
    }

    .site-title {
        font-size: 20px;
    }

    .tagline {
        font-size: 12px;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        background: #2c3e50;
        position: fixed;
        top: 85px;
        left: 0;
        right: -100%;
        width: 100%;
        padding: 10px 0;
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        transition: 0.3s;
    }

    .nav-menu a {
        padding: 12px 0;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu a:last-child {
        border-bottom: none;
    }

    .nav-menu.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }

    /* Atur posisi menu saat header MENYUSUT (.shrink) */
    .header.shrink .nav-menu {
        top: 60px; /* Sesuaikan dengan tinggi header saat shrink */
    }

    /* Opsional: Sesuaikan ukuran logo/teks di mobile saat shrink agar rapi */
    .header.shrink .logo {
        width: 35px; /* Lebih kecil sedikit dari desktop */
    }

    .header.shrink .site-title {
        font-size: 16px;
    }

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

    /* Hero Section Mobile */
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 40px 20px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        margin-top: 20px;
        gap: 15px;
    }

    /* Services & News Mobile */
    .services-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Profile Section Mobile - Additional improvements */
    .profil-section {
        padding: 40px 15px;
    }

    .profil-section .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .profil-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .profil-box {
        min-height: auto; /* Hapus min-height di mobile */
        padding: 20px;
    }

    .profil-box h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .profil-box p,
    .profil-box ul {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 10px;
    }

    .profil-box ul {
        padding-left: 20px;
    }

    .profil-box ul li {
        margin-bottom: 8px;
    }

    /* Organizational Chart Mobile - IMPROVED */
    .node-box {
        padding: 12px 15px;
        font-size: 14px;
        max-width: 100%; /* Memenuhi lebar profil box */
        min-width: auto; /* Hapus min-width */
        width: 100%; /* Pastikan memenuhi lebar */
        gap: 10px;
        box-sizing: border-box; /* Pastikan padding tidak menambah lebar */
    }

    .node-box i {
        font-size: 18px; /* Perbesar icon */
        margin-top: 0;
    }

    .node-content .jabatan {
        font-size: 13px; /* Perbesar teks jabatan */
        margin-bottom: 3px;
        line-height: 1.4;
    }

    .node-content .nama {
        font-size: 13px; /* Perbesar teks nama */
        line-height: 1.3;
    }

    .org-chart ul li::before {
        left: -15px;
    }

    .org-chart ul li::after {
        left: -15px;
        width: 15px;
        top: 18px; /* Sesuaikan dengan tinggi node box yang lebih besar */
    }

    .org-chart li ul {
        padding-left: 20px; /* Kurangi indentasi untuk menghemat ruang */
    }

    .org-chart > ul > li::before {
        border-left: none !important;
    }

    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Carousel Mobile */
    .carousel-slide img {
        height: 250px;
    }

    .carousel-caption {
        bottom: 10px;
        left: 10px;
        padding: 10px 15px;
    }

    .carousel-caption h3 {
        font-size: 18px;
    }

    .carousel-caption p {
        font-size: 14px;
    }

    .carousel-btn {
        padding: 10px;
        font-size: 18px;
    }

    .carousel-btn.prev {
        left: 10px;
    }

    .carousel-btn.next {
        right: 10px;
    }

    /* Dashboard Mobile */
    .hamburger-btn {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px 15px;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .dashboard-title {
        font-size: 24px;
        margin-top: 10px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .main-widgets,
    .side-widgets {
        gap: 15px;
    }

    .widget-card {
        padding: 20px;
    }

    .chart-container {
        height: 250px;
    }

    /* Login Mobile */
    .login-container {
        padding: 30px 20px;
    }

    .login-header h2 {
        font-size: 24px;
    }
}

/* ================== LENSA KEGIATAN (GALLERY) ================== */
.gallery-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.gallery-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 250px;
    flex: 0 0 calc((100% - 60px) / 4);
    max-width: calc((100% - 60px) / 4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    gap: 15px;
}

.gallery-item:hover .gallery-overlay-hover {
    opacity: 1;
}

.gallery-overlay-hover i {
    color: #3498db; /* Ubah warna ikon jadi biru agar kontras */
    font-size: 2rem;
    transform: translateY(20px); /* Posisi awal agak di bawah */
    transition: all 0.3s ease;
}

.gallery-caption {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding: 0 20px;
    transform: translateY(20px); /* Posisi awal agak di bawah */
    transition: all 0.4s ease; /* Sedikit lebih lambat dari overlay */
}

/* Tombol More */
.gallery-footer {
    text-align: center;
    margin-top: 40px;
}

.gallery-item:hover .gallery-overlay-hover {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay-hover i,
.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.btn-outline {
    display: inline-block;
    padding: 12px 35px;
    border: 2px solid #3498db;
    color: #3498db;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
    cursor: pointer;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

/* LIGHTBOX (PREVIEW) STYLES */
.lightbox {
    position: fixed;
    z-index: 2000; /* Di atas segalanya */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-container {
    max-width: 90%;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: zoomIn 0.3s ease;
}

.lightbox-content {
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    background-color: #000;
    display: block;
}

.lightbox-details {
    padding: 20px;
    background: white;
    text-align: center;
    border-top: 1px solid #eee;
}

#lightbox-desc {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

#lightbox-date {
    font-size: 0.9rem;
    color: #7f8c8d;
    display: block;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.lightbox-close:hover {
    color: #3498db;
}

/* Responsif Galeri Mobile */
@media (max-width: 768px) {
    .gallery-grid {
        /* Tidak perlu mendefinisikan grid-template-columns lagi */
        gap: 15px; /* Sedikit perkecil gap di mobile */
    }
    .gallery-item {
        height: 150px;
        /* HITUNGAN AGAR MUAT 2 KOLOM DI HP */
        /* (100% lebar - 1 gap 15px) dibagi 2 item */
        flex: 0 0 calc((100% - 15px) / 2);
        max-width: calc((100% - 15px) / 2);
    }
}

/* ================== STATS EDIT PAGE ================== */
.stats-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Kolom */
    gap: 30px;
}

/* Agar input number terlihat lebih besar dan jelas */
.stats-edit-grid input[type="number"] {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    padding: 15px;
}

/* Responsif untuk Mobile: Jadi 1 kolom */
@media (max-width: 768px) {
    .stats-edit-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ================== TABLET RESPONSIVE (769px - 1024px) ================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-section {
        gap: 30px;
        padding: 50px 20px;
    }

    .services-grid,
    .news-grid,
    .profil-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* ================== PRINT STYLES ================== */
@media print {
    .header,
    .nav-menu,
    .hamburger,
    .sidebar,
    .hamburger-btn,
    .footer,
    .cta-button,
    .carousel-btn,
    .carousel-dots-container {
        display: none !important;
    }

    body {
        padding-top: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .widget-card,
    .stat-item,
    .service-card,
    .profil-box,
    .news-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
