/**
 * Phoca Premiere Template - Modern Premium Styles
 * ================================================
 * Professional and elegant design enhancements
 * 
 * Features:
 * - Glassmorphism header and cards
 * - Modern gradient accents
 * - Refined typography
 * - Smooth micro-interactions
 * - Reading progress bar
 * - Dark mode refinements
 */

/* =========================================================================
   DESIGN TOKENS - Modern Premium Palette
   ========================================================================= */

:root {
    /* Primary Gradient */
    --ph-modern-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ph-modern-gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --ph-modern-gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --ph-modern-gradient-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    
    /* Glass Effect */
    --ph-glass-bg: rgba(255, 255, 255, 0.75);
    --ph-glass-bg-strong: rgba(255, 255, 255, 0.92);
    --ph-glass-border: rgba(255, 255, 255, 0.3);
    --ph-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --ph-glass-blur: blur(16px);
    
    /* Modern Shadows */
    --ph-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --ph-shadow-md: 0 4px 24px rgba(0, 0, 0, 0.06);
    --ph-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
    --ph-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);
    
    /* Modern Radius */
    --ph-radius-sm: 8px;
    --ph-radius-md: 12px;
    --ph-radius-lg: 16px;
    --ph-radius-xl: 24px;
    --ph-radius-full: 9999px;
    
    /* Transitions */
    --ph-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --ph-transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --ph-transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --ph-transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-bs-theme="dark"] {
    --ph-glass-bg: rgba(15, 23, 42, 0.8);
    --ph-glass-bg-strong: rgba(30, 41, 59, 0.95);
    --ph-glass-border: rgba(255, 255, 255, 0.1);
    --ph-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    
    --ph-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --ph-shadow-md: 0 4px 24px rgba(0, 0, 0, 0.2);
    --ph-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.25);
    --ph-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* =========================================================================
   TYPOGRAPHY - Refined & Modern
   ========================================================================= */

body {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    font-weight: 700;
    line-height: 1.25;
}

h1 { letter-spacing: -0.03em; }
h2 { letter-spacing: -0.025em; }

/* Modern text selection */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: inherit;
}

/* =========================================================================
   GLASSMORPHISM HEADER
   ========================================================================= */

.container-header {
    background: var(--ph-glass-bg) !important;
    backdrop-filter: var(--ph-glass-blur) saturate(180%);
    -webkit-backdrop-filter: var(--ph-glass-blur) saturate(180%);
    border-bottom: 1px solid var(--ph-glass-border) !important;
    box-shadow: var(--ph-glass-shadow) !important;
    transition: background var(--ph-transition-base), 
                box-shadow var(--ph-transition-base),
                backdrop-filter var(--ph-transition-base);
}

.container-header.scrolled {
    background: var(--ph-glass-bg-strong) !important;
    box-shadow: var(--ph-shadow-md) !important;
}

/* =========================================================================
   MODERN CARD DESIGN
   ========================================================================= */

.ph-item-box,
.card,
.phModParticlesItem {
    border: none !important;
    border-radius: var(--ph-radius-lg) !important;
    background: var(--ph-glass-bg-strong) !important;
    box-shadow: var(--ph-shadow-md) !important;
    transition: transform var(--ph-transition-base), 
                box-shadow var(--ph-transition-base) !important;
    overflow: hidden;
}

.ph-item-box:hover,
.card:hover,
.phModParticlesItem:hover {
    transform: translateY(-4px);
    box-shadow: var(--ph-shadow-lg) !important;
}

/* Card with accent border */
.ph-item-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ph-modern-gradient-primary);
    opacity: 0;
    transition: opacity var(--ph-transition-base);
}

.ph-item-box:hover::before {
    opacity: 1;
}

/* =========================================================================
   MODERN BUTTONS
   ========================================================================= */

.btn {
    border-radius: var(--ph-radius-md) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all var(--ph-transition-base) !important;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--ph-modern-gradient-primary) !important;
    border: none !important;
    color: #fff !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35) !important;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent !important;
    border: 2px solid currentColor !important;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    transform: translateY(-2px);
}

.btn-outline-primary {
    border: 2px solid #667eea !important;
    color: #667eea !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background: var(--ph-modern-gradient-primary) !important;
    border-color: transparent !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* Button ripple effect */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.btn:active::after {
    opacity: 1;
    transform: scale(2);
    transition: transform 0s, opacity 0s;
}

/* =========================================================================
   MODERN FORM ELEMENTS
   ========================================================================= */

.form-control,
.form-select {
    border-radius: var(--ph-radius-md) !important;
    border: 2px solid rgba(0, 0, 0, 0.08) !important;
    padding: 0.75rem 1rem !important;
    transition: all var(--ph-transition-base) !important;
    background: var(--ph-glass-bg-strong) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* =========================================================================
   NAVIGATION REFINEMENTS
   ========================================================================= */

.mod-menu > li > a {
    position: relative;
    transition: color var(--ph-transition-fast);
}

.mod-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--ph-modern-gradient-primary);
    transition: width var(--ph-transition-base), left var(--ph-transition-base);
}

.mod-menu > li:hover > a::after,
.mod-menu > li.active > a::after {
    width: 100%;
    left: 0;
}

/* Dropdown styling */
.dropdown-menu {
    border: none !important;
    border-radius: var(--ph-radius-lg) !important;
    box-shadow: var(--ph-shadow-lg) !important;
    background: var(--ph-glass-bg-strong) !important;
    backdrop-filter: var(--ph-glass-blur);
    -webkit-backdrop-filter: var(--ph-glass-blur);
    padding: 0.5rem !important;
    margin-top: 0.5rem !important;
}

.dropdown-item {
    border-radius: var(--ph-radius-sm) !important;
    padding: 0.6rem 1rem !important;
    transition: all var(--ph-transition-fast);
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    transform: translateX(4px);
}

/* =========================================================================
   READING PROGRESS BAR
   ========================================================================= */

.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 99999;
    background: transparent;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    background: var(--ph-modern-gradient-primary);
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* =========================================================================
   MODERN BADGES & LABELS
   ========================================================================= */

.badge {
    border-radius: var(--ph-radius-full) !important;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.4em 0.8em !important;
}

.ph-corner-icon-new,
.ph-corner-icon-popular,
.ph-corner-icon-sale {
    border-radius: var(--ph-radius-md) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: var(--ph-shadow-sm);
}

/* =========================================================================
   PAGINATION MODERN STYLE
   ========================================================================= */

.pagination .page-link {
    border: none !important;
    border-radius: var(--ph-radius-md) !important;
    margin: 0 0.25rem;
    padding: 0.6rem 0.9rem !important;
    background: var(--ph-glass-bg-strong) !important;
    box-shadow: var(--ph-shadow-sm);
    transition: all var(--ph-transition-fast);
}

.pagination .page-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--ph-shadow-md);
}

.pagination .page-item.active .page-link {
    background: var(--ph-modern-gradient-primary) !important;
    color: #fff !important;
}

/* =========================================================================
   MODERN ALERTS
   ========================================================================= */

.alert {
    border: none !important;
    border-radius: var(--ph-radius-lg) !important;
    box-shadow: var(--ph-shadow-md);
}

.alert-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-left: 4px solid #667eea !important;
}

.alert-success {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.15) 0%, rgba(56, 249, 215, 0.15) 100%);
    border-left: 4px solid #43e97b !important;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.15) 0%, rgba(245, 87, 108, 0.15) 100%);
    border-left: 4px solid #f5576c !important;
}

/* =========================================================================
   MODAL REFINEMENTS
   ========================================================================= */

.modal-content {
    border: none !important;
    border-radius: var(--ph-radius-xl) !important;
    box-shadow: var(--ph-shadow-xl) !important;
    background: var(--ph-glass-bg-strong) !important;
    backdrop-filter: var(--ph-glass-blur);
    -webkit-backdrop-filter: var(--ph-glass-blur);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 1.25rem 1.5rem;
}

/* =========================================================================
   OFFCANVAS REFINEMENTS
   ========================================================================= */

.offcanvas {
    border: none !important;
    box-shadow: var(--ph-shadow-xl) !important;
}

.offcanvas-start {
    border-radius: 0 var(--ph-radius-xl) var(--ph-radius-xl) 0 !important;
}

.offcanvas-end {
    border-radius: var(--ph-radius-xl) 0 0 var(--ph-radius-xl) !important;
}

.offcanvas-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.offcanvas-body {
    padding: 1.5rem;
}

/* =========================================================================
   FOOTER REFINEMENTS
   ========================================================================= */

.container-footer {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
}

[data-bs-theme="dark"] .container-footer {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

/* =========================================================================
   SPACING REFINEMENTS
   ========================================================================= */

.container-main {
    padding: 3rem 0;
}

.phModParticles {
    padding: 4rem 0;
}

/* Content max-width for readability */
.item-page,
.article-content,
.com-content-article__body {
    max-width: 75ch;
}

.item-page.wide,
.article-content.wide {
    max-width: none;
}

/* =========================================================================
   IMAGE REFINEMENTS
   ========================================================================= */

img {
    border-radius: var(--ph-radius-md);
    transition: transform var(--ph-transition-base);
}

a:hover img {
    transform: scale(1.02);
}

/* Image zoom container */
.phModParticlesItemImage:has(.phAnimZoomImage) {
    border-radius: var(--ph-radius-lg);
    overflow: hidden;
}

/* =========================================================================
   SCROLL ANIMATIONS
   ========================================================================= */

/* Fade in on scroll */
.ph-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.ph-fade-in.ph-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================================
   DARK MODE SPECIFIC REFINEMENTS
   ========================================================================= */

[data-bs-theme="dark"] body {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

[data-bs-theme="dark"] .btn-primary {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25) !important;
}

[data-bs-theme="dark"] .btn-primary:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35) !important;
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .btn:hover,
    .ph-item-box:hover,
    .card:hover {
        transform: none !important;
    }
}

/* =========================================================================
   PRINT STYLES
   ========================================================================= */

@media print {
    .reading-progress-container,
    .container-header,
    .container-footer {
        display: none !important;
    }
    
    .ph-item-box,
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
}

/* =========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================= */

@media (max-width: 768px) {
    :root {
        --ph-radius-lg: 12px;
        --ph-radius-xl: 16px;
    }
    
    .container-main {
        padding: 2rem 0;
    }
    
    .phModParticles {
        padding: 2.5rem 0;
    }
    
    .btn {
        padding: 0.6rem 1.2rem !important;
    }
}

@media (max-width: 576px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .container-main {
        padding: 1.5rem 0;
    }
}
