/**
 * ==========================================
 * PUBLIC DASHBOARD - MODERN CSS
 * ==========================================
 * Styling untuk Public Dashboard Pendapatan Daerah
 * Design: Modern, Glassmorphism, Gradient
 * Color Scheme: #667eea (Primary), #764ba2 (Secondary)
 */

/* ==========================================
   ROOT VARIABLES
   ========================================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #71dd37;
    --info-color: #03c3ec;
    --warning-color: #ffab00;
    --danger-color: #ff3e1d;
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #71dd37 0%, #5cb85c 100%);
    --gradient-info: linear-gradient(135deg, #03c3ec 0%, #0099cc 100%);
    --gradient-warning: linear-gradient(135deg, #ffab00 0%, #ff9800 100%);
    
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==========================================
   GENERAL STYLES
   ========================================== */
body {
    font-family: 'Public Sans', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding-top: 80px; /* Space for fixed navbar */
}

/* ==========================================
   NAVBAR STYLES
   ========================================== */
#publicNavbar {
    background: var(--gradient-primary);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition-smooth);
}

#publicNavbar.scrolled {
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
}

/* Navbar Brand */
.navbar-brand {
    transition: var(--transition-smooth);
    padding: 0.5rem 0;
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Navbar Links */
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition-smooth);
    position: relative;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-nav .nav-link i {
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Mobile Navbar Toggle */
.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* ==========================================
   MODERN CARDS - GLASSMORPHISM
   ========================================== */
.card-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
    overflow: hidden;
    position: relative;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    transform: rotate(45deg);
    pointer-events: none;
}

.card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Summary Cards */
.summary-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
}

.summary-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 28px;
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.summary-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.summary-card-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card-change {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.summary-card-change.positive {
    color: var(--success-color);
}

.summary-card-change.negative {
    color: var(--danger-color);
}

/* Card Variants */
.summary-card.variant-success .summary-card-icon {
    background: var(--gradient-success);
}

.summary-card.variant-info .summary-card-icon {
    background: var(--gradient-info);
}

.summary-card.variant-warning .summary-card-icon {
    background: var(--gradient-warning);
}

/* ==========================================
   CHART CONTAINER
   ========================================== */
.chart-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* ==========================================
   TABLE STYLES
   ========================================== */
.table-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.table-modern thead {
    background: var(--gradient-primary);
}

.table-modern thead th {
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    padding: 1rem;
    border: none;
}

.table-modern tbody tr {
    transition: var(--transition-smooth);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table-modern tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

.table-modern tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: #2d3748;
}

/* Progress Bar in Table */
.progress-modern {
    height: 8px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.1);
    overflow: hidden;
}

.progress-bar-gradient {
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Status Badges */
.badge-modern {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #d4f4dd 0%, #b8e6cc 100%);
    color: #0f5132;
}

.badge-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #997404;
}

.badge-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #7f1d1d;
}

/* ==========================================
   FOOTER STYLES
   ========================================== */
.footer-public {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.footer-brand {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.footer-brand-text {
    color: #ffffff;
}

.footer-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.footer-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-info i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.social-link:hover {
    background: var(--gradient-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: #ffffff;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

.footer-copyright {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Apply animations */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* ==========================================
   LOADING STATES
   ========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-modern {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

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

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

/* ==========================================
   BUTTONS
   ========================================== */
.btn-modern {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    transition: var(--transition-smooth);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-modern:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary-gradient {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 991.98px) {
    .main-content {
        padding-top: 70px;
    }
    
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
    }
    
    .summary-card {
        margin-bottom: 1rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .footer-public .row {
        text-align: center !important;
    }
    
    .footer-social {
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .brand-title {
        font-size: 0.95rem;
    }
    
    .brand-subtitle {
        font-size: 0.7rem;
    }
    
    .summary-card-value {
        font-size: 1.5rem;
    }
    
    .chart-title {
        font-size: 1.1rem;
    }
    
    .table-modern {
        font-size: 0.875rem;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-modern {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

.shadow-hover-modern {
    transition: var(--transition-smooth);
}

.shadow-hover-modern:hover {
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.25) !important;
}

.rounded-modern {
    border-radius: 20px !important;
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    #publicNavbar,
    .footer-public {
        display: none;
    }
    
    .main-content {
        padding-top: 0;
    }
    
    .card-modern,
    .summary-card,
    .chart-container {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
