﻿/* Custom CSS for E-Commerce & Kasir System */

:root {
    --primary-color: #28a745;
    --primary-dark: #1e7e34;
    --primary-light: #5cb85c;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --white: #ffffff;
    --green-gradient-start: #28a745;
    --green-gradient-end: #20c997;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    padding-top: 70px; /* tinggi navbar fixed */
}

/* Khusus halaman hero (index) â€” hero section mengisi sisa layar */
body.hero-page {
    padding-top: 0; /* hero langsung dari atas, navbar overlay di atas hero */
}

/* Page wrapper untuk halaman inner */
.page-with-navbar {
    /* padding-top sudah dari body */
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #28a745 0%, #5cb85c 40%, #a8e6cf 70%, #ffffff 100%);
    min-height: calc(100vh - 70px); /* penuh layar dikurangi navbar */
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Hero Section Small (inner pages â€” sits below solid navbar) */
.hero-section-small {
    background: linear-gradient(135deg, #28a745 0%, #5cb85c 40%, #a8e6cf 70%, #ffffff 100%);
    min-height: 35vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 60px 0 50px;
    color: white;
}

.hero-section-small h1,
.hero-section-small p {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.3"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.3"/><circle cx="50" cy="10" r="1" fill="white" opacity="0.3"/><circle cx="10" cy="60" r="1" fill="white" opacity="0.3"/><circle cx="90" cy="40" r="1" fill="white" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.4;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1,
.hero-section p {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-section .btn-light {
    background: white;
    color: var(--primary-color);
    border: none;
    font-weight: 600;
    padding: 12px 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-section .btn-light:hover {
    background: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.2) !important;
    border-color: var(--primary-light);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 1.5rem;
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.navbar-dark .navbar-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* Admin Panel Styles */
.admin-sidebar {
    background: var(--dark-color);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background: var(--primary-color);
}

.admin-sidebar .nav-link i {
    width: 20px;
    margin-right: 0.5rem;
}

.admin-content {
    margin-left: 250px;
    padding: 2rem;
    min-height: 100vh;
    background: var(--light-color);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.show { display: block; }

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    background: var(--light-color);
}

.table td {
    vertical-align: middle;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.stats-card .stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.stats-card .stats-label {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Kasir Interface */
.kasir-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.product-search {
    background: var(--light-color);
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.cart-section {
    padding: 1.5rem;
}

.cart-item {
    background: var(--light-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: between;
}

.cart-total {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-area,
    .print-area * {
        visibility: visible;
    }
    
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Receipt Styles */
.receipt {
    width: 80mm;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    margin: 0 auto;
    background: white;
    padding: 10px;
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.receipt-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.receipt-info {
    margin-bottom: 10px;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.receipt-table th,
.receipt-table td {
    text-align: left;
    padding: 2px 0;
    border-bottom: 1px dotted #ccc;
}

.receipt-table th {
    font-weight: bold;
}

.receipt-total {
    border-top: 1px dashed #000;
    padding-top: 10px;
    margin-top: 10px;
}

.receipt-footer {
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #000;
}

/* Responsive Design */
@media (max-width: 991px) {
    .hero-section {
        text-align: center;
        padding: 100px 20px 60px;
        min-height: 90vh;
    }
    
    .hero-section .display-3 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .hero-section-small {
        min-height: 30vh;
        padding: 50px 20px 40px;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    .btn-hero-primary,
    .btn-hero-outline {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .hero-section .display-3 {
        font-size: 2rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 8px 18px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* Footer Logo */

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: #d1edff;
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* ========================================
   MODERN ANIMATIONS & EFFECTS
   ======================================== */

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Hero Badge */
.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 25px;
    border-radius: 50px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #e8f5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Buttons */
.btn-hero-primary {
    background: white;
    color: #28a745;
    border: none;
    font-weight: 600;
    padding: 15px 35px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-hero-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-hero-primary:hover::before {
    left: 100%;
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    color: #1e7e34;
}

.btn-hero-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
    font-weight: 600;
    padding: 15px 35px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-hero-outline:hover {
    background: white;
    color: #28a745;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* Hero Stats */
.hero-stat {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.hero-stat:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.scroll-indicator:hover {
    opacity: 1;
}

/* Particles Effect */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 15s infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Navbar Scroll Effect */
.navbar-scrolled {
    background: rgba(40, 167, 69, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Product Card Enhanced */
.product-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(40, 167, 69, 0.1), transparent);
    transition: left 0.5s;
}

.product-card:hover::before {
    left: 100%;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(40, 167, 69, 0.3) !important;
}

.product-card .card-img-top {
    transition: transform 0.5s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.1);
}

/* Section Title Animation */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #5cb85c);
    border-radius: 2px;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Glassmorphism Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Hover Glow Effect */
.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.6),
                0 0 40px rgba(40, 167, 69, 0.4),
                0 0 60px rgba(40, 167, 69, 0.2);
}

/* Responsive Animations */
@media (max-width: 768px) {
    .hero-badge {
        font-size: 0.8rem;
        padding: 8px 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .btn-hero-primary,
    .btn-hero-outline {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .particle {
        width: 2px;
        height: 2px;
    }
}

/* Smooth Transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus States */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}
