:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
}

.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

.navbar-nav .nav-link {
    color: white !important;
    font-weight: 500;
    margin: 0 10px;
    position: relative;
    transition: all 0.3s;
}

.navbar-nav .nav-link:hover {
    color: #fbbf24 !important;
}

.navbar-nav .nav-link:not(.dropdown-toggle)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: #fbbf24;
    transition: all 0.3s;
}

.navbar-nav .nav-link:not(.dropdown-toggle):hover::after {
    width: 100%;
    left: 0;
}

.nav-link.dropdown-toggle::after {
    margin-left: 0.4em;
    vertical-align: middle;
}

.dropdown-menu {
    left: auto;
    right: auto;
    min-width: max-content;
}

.dropdown-item:hover {
    background-color: #fbbf24;
    color: #000 !important;
}

.hero-section {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(30, 64, 175, 0.9)), url('/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    height: 70vh;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
}

.card-custom {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    transition: all 0.3s;
    overflow: hidden;
}

.card-custom:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.btn-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

.stats-box {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.stats-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.footer-custom {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem 0;
}

.news-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    transition: all 0.3s;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.news-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.news-date {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.floating-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    text-decoration: none;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.floating-whatsapp:hover {
    background-color: #20ba5a;
    transform: scale(1.1);
}

.floating-whatsapp i {
    line-height: 1;
}

@media (max-width: 768px) {
    .hero-section {
        height: 50vh;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

/* UMKM Custom Styles */

.card-custom {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

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

/* UMKM Cards */
.umkm-card {
    transition: all 0.3s ease;
}

.umkm-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Product Cards */
.product-card {
    height: 100%;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.product-image {
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #28a745;
}

/* Gallery Styles */
.gallery-img {
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-img:hover {
    transform: scale(1.05);
    border-radius: 8px;
}

/* Thumbnail Gallery for Product Detail */
.thumbnail-img {
    opacity: 0.7;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.thumbnail-img:hover {
    opacity: 1;
    transform: scale(1.1);
}

.thumbnail-img.active {
    opacity: 1;
    border-color: #007bff;
    transform: scale(1.1);
}

/* Status Badges */
.badge-status {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.badge-lg {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* UMKM Info Cards */
.umkm-info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #007bff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Contact Buttons */
.btn-whatsapp {
    background-color: #25d366;
    border-color: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    border-color: #128c7e;
    color: white;
}

/* Sticky Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 20px;
    z-index: 10;
}

/* Category Filter Dropdown */
.category-filter {
    min-width: 200px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* UMKM Grid */
.umkm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-grid,
    .umkm-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-custom {
        margin-bottom: 1rem;
    }
    
    .product-image {
        height: 180px;
    }
}

/* Loading states */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Admin specific styles */
.admin-stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.admin-stats-card .card-body {
    padding: 1.5rem;
}

.admin-stats-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Search box styles */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 2.5rem;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Featured product highlight */
.featured-product {
    position: relative;
    overflow: hidden;
}

.featured-product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    z-index: 1;
}

/* Animation classes for page transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.document-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

/* Document Type Icons */
.document-type-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
}

.document-type-icon.perdes {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.document-type-icon.keputusan {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: white;
}

/* Status Badges */
.status-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: 500;
}

.status-badge.berlaku {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.draft {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-badge.dicabut {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-badge.direvisi {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Document Info Styles */
.document-info {
    padding: 1.5rem;
}

.document-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.document-title {
    font-size: 1rem;
    color: #007bff;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.document-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.document-meta {
    font-size: 0.8rem;
    color: #8c8c8c;
}

.document-meta i {
    width: 14px;
    text-align: center;
    margin-right: 0.3rem;
}

/* PDF Viewer Container */
.pdf-viewer-container {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdf-viewer-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: between;
    align-items: center;
}

.pdf-viewer-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Statistics Cards */
.stat-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.stat-icon.views {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.stat-icon.downloads {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.stat-icon.total {
    background: linear-gradient(135deg, #6f42c1, #5a2d91);
    color: white;
}

/* Navigation Pills */
.nav-pills-custom .nav-link {
    background: transparent;
    border: 2px solid #e9ecef;
    color: #6c757d;
    border-radius: 25px;
    padding: 0.6rem 1.2rem;
    margin: 0 0.3rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-pills-custom .nav-link:hover {
    border-color: #007bff;
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.nav-pills-custom .nav-link.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Filter Form Styles */
.filter-form {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
}

.filter-form .form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.6rem 0.75rem;
    transition: all 0.3s ease;
}

.filter-form .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Document Detail Styles */
.document-detail-header {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.document-badge-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.info-item {
    display: flex;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-item i {
    width: 20px;
    color: #6c757d;
    margin-right: 0.5rem;
    margin-top: 0.2rem;
}

.info-label {
    font-weight: 600;
    color: #333;
    min-width: 140px;
}

.info-value {
    color: #6c757d;
    flex: 1;
}

/* Sidebar Styles */
.sidebar-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.sidebar-card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #333;
}

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

/* Download Button Styles */
.download-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.download-btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Search Box */
.search-box-custom {
    position: relative;
    margin-bottom: 1rem;
}

.search-box-custom input {
    padding-left: 3rem;
    border-radius: 25px;
    border: 2px solid #e9ecef;
    padding: 0.8rem 1rem 0.8rem 3rem;
}

.search-box-custom .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
}

/* Breadcrumb Custom */
.breadcrumb-custom {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-custom .breadcrumb-item {
    font-size: 0.9rem;
}

.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .document-card {
        margin-bottom: 1rem;
    }
    
    .document-detail-header {
        padding: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-pills-custom {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-pills-custom .nav-link {
        margin: 0;
        text-align: center;
    }
    
    .filter-form {
        padding: 1rem;
    }
    
    .pdf-viewer-container iframe {
        height: 400px !important;
    }
}

/* Loading States */
.document-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 20px;
    margin-bottom: 10px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Print Styles */
@media print {
    .sidebar-card,
    .filter-form,
    .nav-pills-custom,
    .download-btn {
        display: none !important;
    }
    
    .document-detail-header {
        border: 1px solid #333;
        page-break-inside: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .document-card {
        border: 2px solid #333;
    }
    
    .status-badge {
        border-width: 2px;
        font-weight: 600;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .document-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .document-title {
        color: #63b3ed;
    }
    
    .document-description {
        color: #a0aec0;
    }
    
    .filter-form {
        background: linear-gradient(135deg, #2d3748, #1a202c);
        border-color: #4a5568;
    }
    
    .sidebar-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}