/* 🔧 COMPREHENSIVE FIXES FOR TEMPLE WEBSITE
 * Date: February 12, 2026
 * Purpose: Fix all positioning, icon, button, and text issues
 */

/* ========================================
   1. FLOATING ACTION BUTTONS (FABs) FIXES
   ======================================== */

.floating-actions {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fab {
    width: 56px;
    height: 56px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.fab i {
    font-size: 1.5rem;
    line-height: 1;
}

.fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.fab-call {
    background: #4CAF50;
    color: white !important;
}

.fab-whatsapp {
    background: #25D366;
    color: white !important;
}

.fab-location {
    background: #FF6347;
    color: white !important;
}

.fab-donate {
    background: #FFD700;
    color: #8B0000 !important;
}

@media (max-width: 768px) {
    .floating-actions {
        right: 1rem;
        bottom: 1rem;
        gap: 0.75rem;
    }
    
    .fab {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    .fab i {
        font-size: 1.2rem;
    }
}

/* ========================================
   2. BUTTON FIXES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    min-width: 44px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn i {
    font-size: 1.1em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-gold);
    color: var(--primary-maroon);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-maroon);
    border: 2px solid var(--primary-maroon);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* ========================================
   3. TYPOGRAPHY FIXES
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    word-break: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

.temple-name-long,
.hero-content h1,
.hero-content-clean h1,
.hero-content-enhanced h1 {
    font-size: clamp(1.5rem, 3vw + 1rem, 3rem) !important;
    line-height: 1.3;
    word-break: break-word;
}

.tagline {
    font-size: clamp(1rem, 2vw + 0.5rem, 1.5rem) !important;
    line-height: 1.5;
}

/* ========================================
   4. CARD LAYOUT FIXES
   ======================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.card h3, .card h4 {
    word-break: break-word;
    hyphens: auto;
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ========================================
   5. NAVIGATION FIXES
   ======================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--temple-red);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--temple-red);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }
}

/* ========================================
   6. FOOTER FIXES
   ======================================== */

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ========================================
   7. TABLE FIXES (Pooja Page)
   ======================================== */

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

@media (max-width: 768px) {
    table {
        font-size: 0.85rem;
        min-width: 500px;
    }
    
    th, td {
        padding: 0.5rem !important;
    }
}

/* ========================================
   8. FORM FIXES
   ======================================== */

form {
    max-width: 600px;
    margin: 0 auto;
}

form input,
form textarea,
form select {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

form input:focus,
form textarea:focus,
form select:focus {
    outline: none;
    border-color: var(--primary-gold);
}

form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-gray);
}

form button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gold);
    color: var(--primary-maroon);
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

form button[type="submit"]:hover {
    background: var(--primary-maroon);
    color: white;
    transform: translateY(-2px);
}

/* ========================================
   9. RESPONSIVE GRID FIXES
   ======================================== */

@media (max-width: 768px) {
    /* Fix two-column layouts */
    .section div[style*="grid-template-columns: 1fr 2fr"],
    .section div[style*="grid-template-columns: 2fr 1fr"],
    .section div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Fix three-column layouts */
    .section div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

/* ========================================
   10. ICON FIXES
   ======================================== */

i.fas, i.fab, i.far {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.card-icon i,
.fab i {
    display: block;
}

/* Ensure Font Awesome loads */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ========================================
   11. IMAGE FIXES
   ======================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.gallery-image,
.deity-image,
.temple-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 15px;
}

/* ========================================
   12. SCROLL TO TOP BUTTON
   ======================================== */

.scroll-top {
    position: fixed;
    right: 1.5rem;
    bottom: 8rem;
    width: 48px;
    height: 48px;
    background: var(--primary-maroon);
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9997;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.scroll-top.show {
    display: flex;
}

.scroll-top:hover {
    background: var(--primary-gold);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .scroll-top {
        right: 1rem;
        bottom: 6rem;
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   13. LOADING STATES
   ======================================== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--temple-red);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   14. ACCESSIBILITY FIXES
   ======================================== */

*:focus-visible {
    outline: 3px solid var(--deep-saffron);
    outline-offset: 2px;
    border-radius: 4px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--temple-red);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    font-weight: 600;
}

.skip-to-main:focus {
    top: 0;
}

/* ========================================
   15. PRINT STYLES
   ======================================== */

@media print {
    .navbar,
    .floating-actions,
    .scroll-top,
    .mobile-menu-toggle,
    .language-toggle,
    .cta-buttons {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
}

/* ========================================
   16. REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
