/* ============================================================
   Koperasi Desa Merah Putih - Custom Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #DC2626;
    --primary-dark: #B91C1C;
    --primary-light: #FEE2E2;
    --secondary: #1E293B;
    --accent-gold: #D4A843;
    --accent-gold-light: #F5E6C4;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.3;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar-kopdes {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    transition: var(--transition);
    z-index: 1050;
}

.navbar-kopdes.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-kopdes .navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary) !important;
    text-decoration: none;
}

.navbar-kopdes .navbar-brand img {
    height: 45px;
    width: auto;
    border-radius: var(--radius-sm);
}

.navbar-kopdes .nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
    position: relative;
}

.navbar-kopdes .nav-link:hover,
.navbar-kopdes .nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-light);
}

.navbar-kopdes .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #EF4444 100%);
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: heroFloat 8s ease-in-out infinite;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    animation: heroFloat 6s ease-in-out infinite reverse;
}

@keyframes heroFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

.hero-section h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-section p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 520px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #fff;
}

/* Hero Image Showcase */
.hero-image-wrapper {
    position: relative;
    display: inline-block;
    padding: 20px;
}

.hero-image-frame {
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 24px;
    z-index: 2;
    animation: heroFloat 6s ease-in-out infinite;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-image-frame:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.hero-logo {
    width: 500px;
    height: auto;
    border-radius: 16px;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
}

.hero-image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(253, 232, 138, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    animation: heroGlow 4s ease-in-out infinite alternate;
}

.hero-image-dots {
    position: absolute;
    bottom: -10px;
    right: -15px;
    width: 80px;
    height: 80px;
    background-image: radial-gradient(rgba(255, 255, 255, 0.35) 2px, transparent 2px);
    background-size: 12px 12px;
    z-index: 1;
    opacity: 0.6;
}

@keyframes heroGlow {
    0% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-kopdes {
    background: var(--bg-white);
    color: var(--primary);
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 50px;
    border: none;
    transition: var(--transition);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-kopdes:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-dark);
}

.btn-kopdes-primary {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 50px;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-kopdes-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-kopdes-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    font-weight: 600;
    padding: 10px 28px;
    border-radius: 50px;
    transition: var(--transition);
    text-decoration: none;
}

.btn-kopdes-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   SECTION STYLES
   ============================================================ */
.section-padding {
    padding: 80px 0;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent-gold));
    border-radius: 2px;
    margin-bottom: 1rem;
}

.section-divider-center {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent-gold));
    border-radius: 2px;
    margin: 0 auto 1rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card-kopdes {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
}

.card-kopdes:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.card-kopdes .card-img-top {
    height: 220px;
    object-fit: cover;
}

.card-kopdes .card-body {
    padding: 1.5rem;
}

.card-kopdes .card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.card-kopdes .card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Unit Cards */
.unit-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
}

.unit-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.unit-card .unit-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-light), #fff);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2rem;
    color: var(--primary);
    transition: var(--transition);
}

.unit-card:hover .unit-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    transform: scale(1.1);
}

/* Stats Cards */
.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================================
   NEWS CARDS
   ============================================================ */
.news-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card:hover {
    color: inherit;
}

.news-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.news-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

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

.gallery-overlay h6 {
    color: #fff;
    font-weight: 600;
    margin: 0;
}

/* Filter Buttons */
.filter-btn {
    padding: 8px 20px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--bg-white);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
    text-decoration: none;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================================
   ANNOUNCEMENT BANNER
   ============================================================ */
.announcement-bar {
    background: linear-gradient(90deg, var(--accent-gold), #E8B94E);
    color: var(--text-dark);
    padding: 10px 0;
    font-size: 0.85rem;
    font-weight: 500;
}

.announcement-card {
    background: linear-gradient(135deg, #FFF7ED, #FFFBEB);
    border: 1px solid #FDE68A;
    border-left: 4px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-kopdes {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    color: #CBD5E1;
    padding: 60px 0 0;
}

.footer-kopdes h5 {
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

.footer-kopdes a {
    color: #94A3B8;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-kopdes a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.85rem;
    color: #64748B;
}

.footer-kopdes .footer-logo {
    height: 50px;
    width: auto;
    margin-bottom: 1rem;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 80px 0 80px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg-light);
    border-radius: 40px 40px 0 0;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.breadcrumb-kopdes {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.85;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-kopdes a {
    color: #fff;
    text-decoration: none;
}

.breadcrumb-kopdes a:hover {
    text-decoration: underline;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-info-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.contact-info-card:hover {
    box-shadow: var(--shadow-md);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-content-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (min-width: 992px) {
    .about-content-card {
        padding: 2.5rem;
    }
}

.about-sidebar-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.content-area {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.8;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.content-area p {
    margin-bottom: 1rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .hero-section {
        min-height: 70vh;
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }

    .hero-logo {
        width: 200px;
    }

    .hero-image-wrapper {
        margin-top: 2rem;
    }

    .hero-image-frame {
        padding: 18px;
    }

    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        min-height: auto;
        padding: 60px 0;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section p {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-logo {
        width: 150px;
    }

    .hero-image-frame {
        padding: 16px;
        border-radius: 18px;
    }

    .hero-image-glow {
        width: 200px;
        height: 200px;
    }

    .hero-image-dots {
        display: none;
    }

    .section-padding {
        padding: 50px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }
}

/* ============================================================
   ADMIN PANEL STYLES
   ============================================================ */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: var(--transition);
    overflow-y: auto;
}

.admin-sidebar .sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar .sidebar-brand img {
    height: 40px;
    border-radius: 8px;
}

.admin-sidebar .sidebar-brand span {
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
}

.admin-sidebar .nav-section {
    padding: 1rem 0.75rem;
}

.admin-sidebar .nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #475569;
    font-weight: 600;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #94A3B8 !important;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}

.admin-sidebar .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar .nav-link.active {
    color: #fff !important;
    background: var(--primary);
}

.admin-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.admin-content {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--bg-light);
}

.admin-topbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.admin-topbar h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-dark);
}

.admin-main {
    padding: 2rem;
}

/* Admin Dashboard Cards */
.dash-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.dash-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dash-card .dash-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.dash-card .dash-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
}

.dash-card .dash-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Admin Tables */
.table-kopdes {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.table-kopdes thead th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
}

.table-kopdes td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

/* Admin Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #EF4444 100%);
    position: relative;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

.login-card .login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-kopdes .form-control,
.form-kopdes .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-kopdes .form-control:focus,
.form-kopdes .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-kopdes label {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-dark);
    margin-bottom: 6px;
}

/* Utility */
.text-primary-kopdes {
    color: var(--primary) !important;
}

.bg-primary-kopdes {
    background: var(--primary) !important;
}

.text-gold {
    color: var(--accent-gold) !important;
}

/* Animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-delay-1 {
    animation-delay: 0.1s;
}

.fade-in-delay-2 {
    animation-delay: 0.2s;
}

.fade-in-delay-3 {
    animation-delay: 0.3s;
}

.fade-in-delay-4 {
    animation-delay: 0.4s;
}

/* Mobile sidebar toggle */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }
}