/* Modern Website Enhancements */

/* Initial page load state - hide main content */
body.no-scroll #mainContent {
    opacity: 0;
    visibility: hidden;
}

/* After welcome overlay dismissed - show main content */
#mainContent {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--premium-gold), #A88A3F);
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(192, 160, 76, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 30px rgba(192, 160, 76, 0.5);
}

.back-to-top:active {
    transform: translateY(-2px) scale(0.95);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--premium-gold), #A88A3F);
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(192, 160, 76, 0.5);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.toast {
    background: linear-gradient(135deg, #0f0f0f, #080808);
    border: 2px solid var(--premium-gold);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success {
    border-color: #4CAF50;
}

.toast.error {
    border-color: #f44336;
}

.toast.warning {
    border-color: #ff9800;
}

.toast.info {
    border-color: var(--premium-gold);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: var(--premium-gold);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.toast-message {
    color: #ddd;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(192, 160, 76, 0.3);
    border-radius: 50%;
    border-top-color: var(--premium-gold);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.button-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 0.8s linear infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #0f0f0f 25%, #1a1a1a 50%, #0f0f0f 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Animation Delay */
.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }

/* Enhanced Form Validation */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-error {
    display: none;
    color: #f44336;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    animation: shake 0.4s ease;
}

.form-error.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.input-error {
    border-color: #f44336 !important;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2) !important;
}

.input-success {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2) !important;
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-icon.show {
    opacity: 1;
}

.input-icon.success {
    color: #4CAF50;
}

.input-icon.error {
    color: #f44336;
}

/* Social Sharing Buttons */
.social-share {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.social-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid rgba(192, 160, 76, 0.3);
    background: rgba(192, 160, 76, 0.05);
    color: var(--premium-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-btn:hover {
    background: rgba(192, 160, 76, 0.15);
    border-color: var(--premium-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 160, 76, 0.3);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 15, 0.98);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(192, 160, 76, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(15, 15, 15, 0.98);
}

.tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Enhanced Buttons */
.btn-modern {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-modern:hover::before {
    width: 300px;
    height: 300px;
}

.btn-modern span {
    position: relative;
    z-index: 1;
}

/* Image Lazy Loading Enhancement */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Smooth Page Transitions */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--premium-gold), #A88A3F);
    z-index: 99999;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
    transform: scaleY(1);
    transform-origin: top;
}

/* Enhanced Cards */
.card-modern {
    position: relative;
    overflow: hidden;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(192, 160, 76, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.card-modern:hover::before {
    opacity: 1;
}

/* Active Navigation Indicator */
.nav-active-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--premium-gold);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
}

/* Enhanced Footer */
.footer-modern {
    position: relative;
    overflow: hidden;
}

.footer-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--premium-gold), transparent);
}

/* Mobile Enhancements */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .social-share {
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .back-to-top,
    .toast-container,
    .reading-progress,
    .menu-container {
        display: none !important;
    }
}

/* Focus Visible Enhancement */
*:focus-visible {
    outline: 2px solid var(--premium-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

