/* ============================================
   Vieva Dignity - Premium Styles
   Social Enterprise Management System
   ============================================ */

:root {
    --gold: #D4AF37;
    --charcoal: #1A1A1A;
    --soft-gray: #F8F9FA;
    --white: #FFFFFF;
    --whatsapp: #25D366;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--white);
    color: var(--charcoal);
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

h1, h2, h3, .serif {
    font-family: 'Playfair Display', serif;
}

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8942e;
}

/* ============================================
   Typography
   ============================================ */
.gold-text { color: var(--gold); }
.bg-gold { background-color: var(--gold); }
.bg-charcoal { background-color: var(--charcoal); }

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    background: var(--charcoal);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover {
    background: #2d2d2d;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.btn-outline-gold {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--charcoal);
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline-gold:hover {
    background: var(--gold);
    color: var(--charcoal);
    transform: translateY(-2px);
}

/* ============================================
   Cards
   ============================================ */
.glass-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 40px -12px rgba(0,0,0,0.15);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Counter Animation
   ============================================ */
.counter {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    color: var(--gold);
}

/* ============================================
   Logo Styles
   ============================================ */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-image {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Admin Logo Upload */
.logo-preview {
    width: 100px;
    height: 100px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    background: #f9f9f9;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ============================================
   Stat Cards
   ============================================ */
.stat-card {
    background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
    border-radius: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Alert Messages
   ============================================ */
.alert {
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   WhatsApp Widget Styles
   ============================================ */
.whatsapp-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.whatsapp-button {
    background: var(--whatsapp);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.whatsapp-button i {
    font-size: 34px;
    color: white;
}

.whatsapp-chat-preview {
    background: white;
    border-radius: 20px;
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    display: none;
}

.whatsapp-chat-preview.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-header {
    background: var(--whatsapp);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.whatsapp-header .logo-small {
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-header .logo-small span {
    color: var(--whatsapp);
    font-weight: bold;
    font-size: 16px;
}

.whatsapp-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.whatsapp-header p {
    font-size: 11px;
    opacity: 0.9;
    margin: 0;
}

.whatsapp-body {
    padding: 15px;
    background: #E5DDD5;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.bot-msg {
    background: white;
    padding: 10px 12px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    font-size: 13px;
    max-width: 90%;
    align-self: flex-start;
    color: #111;
    line-height: 1.4;
}

.user-msg {
    background: #DCF8C6;
    padding: 10px 12px;
    border-radius: 18px;
    border-top-right-radius: 4px;
    font-size: 13px;
    max-width: 90%;
    align-self: flex-end;
    color: #111;
    margin-top: 5px;
}

.typing-indicator {
    background: white;
    padding: 10px 14px;
    border-radius: 18px;
    display: inline-block;
    align-self: flex-start;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-10px); opacity: 1; }
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.quick-reply {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply:hover {
    background: var(--gold);
    color: white;
}

.whatsapp-input {
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #ddd;
    gap: 8px;
}

.whatsapp-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 13px;
    outline: none;
}

.whatsapp-input input:focus {
    border-color: var(--whatsapp);
}

.whatsapp-input button {
    background: var(--whatsapp);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.whatsapp-input button:hover {
    background: #128C7E;
    transform: scale(1.05);
}

.whatsapp-input button i {
    color: white;
    font-size: 14px;
}

.close-chat {
    background: rgba(0,0,0,0.2);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
}

.close-chat:hover {
    background: rgba(0,0,0,0.3);
}

/* ============================================
   Mobile Navigation Styles
   ============================================ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--charcoal);
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: rgba(0,0,0,0.05);
}

/* Desktop navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Mobile Navigation Menu */
.nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: calc(100vh - 70px);
    background: white;
    flex-direction: column;
    padding: 30px 20px;
    transition: left 0.3s ease;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.nav-links.active {
    left: 0;
}

.nav-links a {
    padding: 14px 0;
    display: block;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: var(--charcoal);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--gold);
    padding-left: 5px;
}

/* Overlay when menu is open */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
}

.menu-overlay.active {
    display: block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .nav-links {
        display: flex;
    }
}

@media (min-width: 769px) {
    .nav-links {
        display: none !important;
    }
    
    .menu-overlay {
        display: none !important;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* ============================================
   Responsive Styles - Mobile First
   ============================================ */

/* Mobile Devices (up to 768px) */
@media (max-width: 768px) {
    /* General */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2.2rem !important;
        line-height: 1.3 !important;
    }
    
    h2 {
        font-size: 1.8rem !important;
    }
    
    /* Counter */
    .counter {
        font-size: 2rem;
    }
    
    /* Buttons */
    .btn-primary, .btn-outline-gold {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
    
    /* Logo */
    .logo-image {
        height: 35px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    /* Sections */
    section {
        padding: 60px 20px !important;
    }
    
    /* Cards */
    .glass-card {
        padding: 20px !important;
        margin-bottom: 20px;
    }
    
    /* Grid layouts - convert to single column */
    .grid-cols-3, 
    .grid-cols-4, 
    .grid-cols-5,
    .md\:grid-cols-2,
    .md\:grid-cols-3,
    .md\:grid-cols-4,
    .md\:grid-cols-5 {
        grid-template-columns: 1fr !important;
    }
    
    /* Flex layouts */
    .flex-wrap {
        flex-direction: column;
        gap: 12px !important;
    }
    
    /* Stat Cards */
    .stat-card {
        padding: 15px !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    /* Contact Page */
    .contact-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Form inputs - prevent zoom on iOS */
    input, 
    select, 
    textarea {
        font-size: 16px !important;
    }
    
    /* Modal */
    .modal-content {
        width: 95% !important;
        margin: 10px;
        padding: 20px !important;
        max-height: 85vh;
    }
    
    /* WhatsApp Widget */
    .whatsapp-chat-preview {
        width: 90vw !important;
        max-width: 320px;
        right: 5vw !important;
        bottom: 80px !important;
    }
    
    .whatsapp-button {
        width: 50px !important;
        height: 50px !important;
    }
    
    .whatsapp-button i {
        font-size: 28px !important;
    }
    
    /* Padding adjustments */
    .py-24 {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }
    
    .px-6 {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .pt-32 {
        padding-top: 100px !important;
    }
    
    /* Space utilities */
    .space-y-3 {
        gap: 10px !important;
    }
    
    .gap-8 {
        gap: 20px !important;
    }
    
    .mt-16 {
        margin-top: 40px !important;
    }
    
    /* Hero buttons */
    .hero-buttons {
        flex-direction: column;
    }
    
    /* Problem section cards */
    .problem-card {
        margin-bottom: 20px;
    }
    
    /* Confine everything to viewport */
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    img, video, iframe {
        max-width: 100%;
        height: auto;
    }
    
    .container, .max-w-7xl {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Tablet Devices (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet grid adjustments */
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .grid-cols-4, 
    .grid-cols-5 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    h1 {
        font-size: 3rem !important;
    }
    
    .whatsapp-chat-preview {
        width: 300px;
    }
}

/* Large Desktop (above 1024px) */
@media (min-width: 1025px) {
    .container {
        max-width: 1280px;
        margin: 0 auto;
    }
}

/* ============================================
   Accessibility & Touch Improvements
   ============================================ */

/* Improve touch targets for mobile */
button, 
.btn-primary, 
.btn-outline-gold,
a,
.quick-reply,
.close-chat,
.whatsapp-button {
    min-height: 44px;
    min-width: 44px;
}

/* Remove tap highlight on mobile */
a, button {
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
}

/* Focus styles for accessibility */
:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ============================================
   Hero Section Styles
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #FFF 0%, #FFF8F0 100%);
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 24px;
    object-fit: cover;
}

/* ============================================
   Problem Section
   ============================================ */
.problem-card {
    background: white;
    border-radius: 24px;
    transition: var(--transition);
}

.problem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -12px rgba(0,0,0,0.1);
}

/* ============================================
   Impact Section
   ============================================ */
.impact-stat {
    text-align: center;
}

/* ============================================
   Testimonials Section
   ============================================ */
.testimonial-card {
    background: white;
    border-radius: 16px;
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -10px rgba(0,0,0,0.1);
}

/* ============================================
   Footer Styles
   ============================================ */
footer a {
    transition: var(--transition);
}

footer a:hover {
    color: var(--gold);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .whatsapp-widget,
    .modal,
    .btn-primary,
    .btn-outline-gold {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .stat-card {
        background: none;
        border: 1px solid #ddd;
    }
    
    .counter {
        color: black;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Additional viewport confinement fixes */
img, video, iframe, canvas, svg {
    max-width: 100%;
    height: auto;
}

* {
    max-width: 100%;
    box-sizing: border-box;
}