/* ====================================
   Global Styles - Toko Buku Digital
   ==================================== */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --whatsapp-green: #25D366;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* Reset dan Base Styles */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    background-color: #f8f9fa;
    padding-top: 56px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
}

main {
    flex: 1;
}

/* ====================================
   HERO SECTION
   ==================================== */

.hero {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 80px 0;
    position: relative;
    min-height: 300px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: slideInDown 0.6s ease-out;
}

.hero p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: slideInUp 0.6s ease-out 0.1s both;
}

.hero .btn {
    animation: slideInUp 0.6s ease-out 0.2s both;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 60px 0;
        min-height: 250px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero {
        padding: 40px 15px;
        min-height: 200px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }
}

/* ====================================
   FOOTER
   ==================================== */

footer {
    background-color: #212529;
    color: #ccc;
    margin-top: auto;
    padding: 2rem 0;
}

footer a {
    color: #ccc;
    text-decoration: none;
    transition: color var(--transition-normal);
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ====================================
   WHATSAPP FLOAT BUTTON
   ==================================== */

.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--whatsapp-green);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.25);
    z-index: 9999;
    text-decoration: none;
    font-size: 22px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.35);
    animation: none;
    color: white;
    text-decoration: none;
}

.whatsapp-float:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* ====================================
   LOADING SPINNER
   ==================================== */

.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ====================================
   NAVBAR ENHANCEMENT
   ==================================== */

.navbar {
    transition: box-shadow var(--transition-normal);
}

.navbar.shadow-lg {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.navbar-brand {
    letter-spacing: 0.5px;
    font-size: 1.4rem;
}

.nav-link {
    transition: color var(--transition-fast);
    border-radius: 0.25rem;
}

.nav-link:hover,
.nav-link.active {
    color: #ffc107 !important;
}

/* ====================================
   ACCESSIBILITY
   ==================================== */

a:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ====================================
   PRINT STYLES
   ==================================== */

@media print {
    .navbar,
    .whatsapp-float,
    footer,
    .banner-container,
    .btn-outline-primary {
        display: none !important;
    }

    body {
        padding-top: 0;
        background-color: white;
    }
}

/* ====================================
   UTILITY CLASSES
   ==================================== */

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.img-responsive {
    max-width: 100%;
    height: auto;
}

.shadow-sm {
    transition: box-shadow var(--transition-normal);
}

.shadow-sm:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15) !important;
}

/* ====================================
   SCROLL BEHAVIOR
   ==================================== */

html {
    scroll-behavior: smooth;
}

/* Smooth scroll fallback untuk browser lama */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}
