/**
 * Index Page Main Styles
 * Author: ร้านเช่าTS4
 * Description: Main styles for the index page including viewport fixes and global improvements
 */

/* ========================================
   VIEWPORT & SMOOTH SCROLLING
   ======================================== */

/* Viewport height fix for mobile browsers */
.min-h-screen {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
}

/* Smooth scrolling for all browsers */
html {
    scroll-behavior: smooth;
}

/* ========================================
   CONTAINER RESPONSIVE IMPROVEMENTS
   ======================================== */

/* Container responsive improvements */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ========================================
   LOADING STATES
   ======================================== */

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ========================================
   CUSTOM GRADIENT TEXT STYLES
   ======================================== */

/* Custom gradient for hero title */
.hero-title-gradient {
    background: var(--theme-gradient, linear-gradient(to right, #f7f7f7, #ba0f61)) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    display: block !important;
    margin-bottom: 0.25rem !important;
    font-weight: bold !important;
}

@media (min-width: 768px) {
    .hero-title-gradient {
        margin-bottom: 0.5rem !important;
    }
}

@media (min-width: 1024px) {
    .hero-title-gradient {
        margin-bottom: 0.75rem !important;
    }
}

.hero-title-gradient .mobile-wrap {
    display: block !important;
}

@media (min-width: 640px) {
    .hero-title-gradient .mobile-wrap {
        display: inline !important;
    }
}

/* ========================================
   ACCESSIBILITY & FOCUS STATES
   ======================================== */

/* Focus states for accessibility */
.focus\:ring-4:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.4);
}

/* Hover effects optimization */
@media (hover: hover) {
    .hover\:scale-105:hover {
        transform: scale(1.05);
    }
}


/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes progressGlow {

    0%,
    100% {
        opacity: 0.3;
        width: 0%;
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    }

    25% {
        opacity: 0.6;
        width: 30%;
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    }

    50% {
        opacity: 1;
        width: 60%;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.7);
    }

    75% {
        opacity: 0.8;
        width: 40%;
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    }
}

.animate-pulse-smooth {
    animation-duration: 2s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

/* CKEditor Rich Text Content Styling */
.text-content h1,
.text-content h2,
.text-content h3,
.text-content h4,
.text-content h5,
.text-content h6 {
    font-weight: 600;
    margin: 0.5rem 0;
    color: #374151;
}

.text-content h1 {
    font-size: 1.5rem;
}

.text-content h2 {
    font-size: 1.3rem;
}

.text-content h3 {
    font-size: 1.1rem;
}

.text-content h4 {
    font-size: 1rem;
}

.text-content p {
    margin: 0.5rem 0;
}

.text-content strong,
.text-content b {
    font-weight: 600;
    color: #1f2937;
}

.text-content em,
.text-content i {
    font-style: italic;
}

.text-content u {
    text-decoration: underline;
}

.text-content s {
    text-decoration: line-through;
}

.text-content ul,
.text-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.text-content ul li {
    list-style-type: disc;
}

.text-content ol li {
    list-style-type: decimal;
}

.text-content li {
    margin: 0.25rem 0;
}

.text-content a {
    color: #7c3aed;
    text-decoration: underline;
}

.text-content a:hover {
    color: #5b21b6;
}

.text-content blockquote {
    border-left: 4px solid #d1d5db;
    margin: 0.5rem 0;
    padding-left: 1rem;
    font-style: italic;
    color: #6b7280;
}

.text-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.text-content th,
.text-content td {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    text-align: left;
}

.text-content th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* Ensure rich text content doesn't break layout */
.text-content * {
    max-width: 100%;
    word-wrap: break-word;
}

.text-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* ========================================
   PENDING ORDER ALERT SECTION - INDEX PAGE SPECIFIC
   ======================================== */

/* Main pending order alert container */
#pendingOrderAlert {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 50%, #fdcb6e 100%) !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(253, 203, 110, 0.3), 
                0 0 20px rgba(255, 234, 167, 0.4) !important;
    backdrop-filter: blur(10px) !important;
    position: relative !important;
    overflow: hidden !important;
    animation: pendingAlertGlow 3s ease-in-out infinite alternate !important;
    margin-bottom: 2rem !important;
    padding: 1.5rem !important;
}

/* Glassmorphism overlay effect */
#pendingOrderAlert::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.1) 100%) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* Content wrapper */
#pendingOrderAlert .d-flex {
    position: relative !important;
    z-index: 2 !important;
}

/* Warning icon styling */
#pendingOrderAlert .fas.fa-exclamation-triangle {
    color: #e17055 !important;
    font-size: 2rem !important;
    text-shadow: 0 2px 10px rgba(225, 112, 85, 0.3) !important;
    animation: pendingIconPulse 2s ease-in-out infinite !important;
    filter: drop-shadow(0 0 10px rgba(225, 112, 85, 0.5)) !important;
}

/* Alert heading */
#pendingOrderAlert .alert-heading {
    color: #2d3436 !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    text-shadow: 0 1px 3px rgba(45, 52, 54, 0.1) !important;
    margin-bottom: 1rem !important;
}

/* Alert text */
#pendingOrderAlert p {
    color: #636e72 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
}

/* Countdown timer styling */
#pendingCountdown {
    background: linear-gradient(135deg, #e17055, #d63031) !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 25px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    box-shadow: 0 4px 15px rgba(214, 48, 49, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    animation: pendingCountdownPulse 1.5s ease-in-out infinite !important;
    display: inline-block !important;
    margin: 0 0.25rem !important;
}

/* Small text styling */
#pendingOrderAlert small {
    color: #74b9ff !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

/* Button container */
#pendingOrderAlert .d-flex.gap-2 {
    gap: 1rem !important;
}

/* Payment button styling */
#pendingOrderAlert .btn-success {
    background: linear-gradient(135deg, #00b894, #00cec9) !important;
    border: none !important;
    border-radius: 15px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
}

#pendingOrderAlert .btn-success::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    transition: left 0.5s !important;
}

#pendingOrderAlert .btn-success:hover::before {
    left: 100% !important;
}

#pendingOrderAlert .btn-success:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* History button styling */
#pendingOrderAlert .btn-primary {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe) !important;
    border: none !important;
    border-radius: 15px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
}

#pendingOrderAlert .btn-primary::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    transition: left 0.5s !important;
}

#pendingOrderAlert .btn-primary:hover::before {
    left: 100% !important;
}

#pendingOrderAlert .btn-primary:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* ========================================
   ANIMATIONS FOR PENDING ORDER ALERT
   ======================================== */

@keyframes pendingAlertGlow {
    0% {
        box-shadow: 0 10px 30px rgba(253, 203, 110, 0.3), 
                    0 0 20px rgba(255, 234, 167, 0.4);
    }
    100% {
        box-shadow: 0 15px 40px rgba(253, 203, 110, 0.5), 
                    0 0 30px rgba(255, 234, 167, 0.6);
    }
}

@keyframes pendingIconPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(225, 112, 85, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(225, 112, 85, 0.8));
    }
}

@keyframes pendingCountdownPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(214, 48, 49, 0.4), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(214, 48, 49, 0.6), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* ========================================
   RESPONSIVE DESIGN FOR PENDING ORDER ALERT
   ======================================== */

@media (max-width: 768px) {
    #pendingOrderAlert {
        margin: 1rem !important;
        padding: 1.25rem !important;
        border-radius: 15px !important;
    }
    
    #pendingOrderAlert .fas.fa-exclamation-triangle {
        font-size: 1.5rem !important;
    }
    
    #pendingOrderAlert .alert-heading {
        font-size: 1.1rem !important;
    }
    
    #pendingOrderAlert .d-flex.gap-2 {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    #pendingOrderAlert .btn-success,
    #pendingOrderAlert .btn-primary {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
    
    #pendingCountdown {
        font-size: 1rem !important;
        padding: 0.375rem 0.75rem !important;
    }
}

@media (max-width: 480px) {
    #pendingOrderAlert {
        margin: 0.5rem !important;
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    #pendingOrderAlert .alert-heading {
        font-size: 1rem !important;
    }
    
    #pendingOrderAlert p {
        font-size: 0.9rem !important;
    }
    
    #pendingCountdown {
        font-size: 0.9rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* ========================================
   URGENT STATE FOR PENDING ORDER ALERT
   ======================================== */

/* Urgent state when time is running out */
#pendingOrderAlert.urgent {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 50%, #f87171 100%) !important;
    animation: pendingUrgentPulse 1s ease-in-out infinite alternate !important;
    border: 2px solid #ef4444 !important;
}

#pendingOrderAlert.urgent .fas.fa-exclamation-triangle {
    color: #dc2626 !important;
    animation: pendingUrgentShake 0.5s ease-in-out infinite !important;
}

#pendingCountdown.urgent {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    animation: pendingUrgentCountdownPulse 0.8s ease-in-out infinite !important;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* ========================================
   URGENT ANIMATIONS
   ======================================== */

@keyframes pendingUrgentPulse {
    0% {
        box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4), 
                    0 0 20px rgba(254, 202, 202, 0.5);
    }
    100% {
        box-shadow: 0 15px 40px rgba(239, 68, 68, 0.6), 
                    0 0 30px rgba(254, 202, 202, 0.7);
    }
}

@keyframes pendingUrgentShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

@keyframes pendingUrgentCountdownPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.6), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 30px rgba(220, 38, 38, 0.8), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}