/* ===================================================================
   Party Group Company - Production-Ready Stylesheet
   Mobile-First Responsive Design | Optimized for Performance
   ================================================================== */

/* ===================================================================
   CSS RESET & PERFORMANCE OPTIMIZATIONS
   ================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent font size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/* ===================================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ================================================================== */
:root {
    /* Primary Colors */
    --primary-color: #e91e63;
    --secondary-color: #9c27b0;
    --accent-color: #ffd700;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #e91e63 0%, #9c27b0 50%, #673ab7 100%);
    --gradient-secondary: linear-gradient(135deg, #f48fb1 0%, #ce93d8 100%);
    --gradient-accent: linear-gradient(135deg, #ff6f91 0%, #ff9671 100%);
    
    /* Service Icon Gradients */
    --gradient-service: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
    --gradient-contact: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --gradient-whatsapp: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    --gradient-email: linear-gradient(135deg, #ea4335 0%, #c53030 100%);
    --gradient-gallery: linear-gradient(135deg, #ff6f91 0%, #ff9671 100%);
    --gradient-location: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    
    /* Social Media Gradients */
    --gradient-instagram: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --gradient-facebook: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
    --gradient-tiktok: linear-gradient(135deg, #000000 0%, #25f4ee 50%, #fe2c55 100%);
    --gradient-youtube: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-bg: #fce4ec;
    --dark-text: #2d3748;
    --light-text: #718096;
    --border-color: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 15px 45px rgba(233, 30, 99, 0.2);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;
    
    /* Typography */
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    /* Animation Durations */
    --duration-fast: 150ms;
    --duration-base: 300ms;
    --duration-slow: 500ms;
    
    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-notification: 500;
}

/* ===================================================================
   BASE STYLES
   ================================================================== */
body {
    font-family: var(--font-family);
    background: var(--gradient-primary);
    min-height: 100vh;
    color: var(--dark-text);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Improve performance by using will-change sparingly */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--spacing-md);
    position: relative;
    min-height: 100vh;
}

/* ===================================================================
   ACCESSIBILITY IMPROVEMENTS
   ================================================================== */
/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
.branch-item:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--white);
    color: var(--dark-text);
    padding: var(--spacing-sm);
    text-decoration: none;
    z-index: var(--z-modal);
}

.skip-link:focus {
    top: 0;
}

/* Reduce motion for users who prefer it */
@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;
    }
}

/* ===================================================================
   ANIMATED BACKGROUND
   ================================================================== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    /* Performance optimization */
    will-change: auto;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    opacity: 0.6;
    animation: confetti-fall 10s linear infinite;
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Confetti variations */
.confetti:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    background: var(--primary-color);
    border-radius: 50%;
}

.confetti:nth-child(2) {
    left: 30%;
    animation-delay: 2s;
    background: var(--accent-color);
    transform: rotate(45deg);
}

.confetti:nth-child(3) {
    left: 50%;
    animation-delay: 4s;
    background: var(--secondary-color);
    border-radius: 50%;
}

.confetti:nth-child(4) {
    left: 70%;
    animation-delay: 6s;
    background: #ff6f91;
    transform: rotate(45deg);
}

.confetti:nth-child(5) {
    left: 90%;
    animation-delay: 8s;
    background: #ce93d8;
    border-radius: 50%;
}

@keyframes confetti-fall {
    0% {
        top: -10%;
        transform: translateX(0) rotate(0deg);
        opacity: 0.6;
    }
    100% {
        top: 110%;
        transform: translateX(100px) rotate(720deg);
        opacity: 0;
    }
}

/* ===================================================================
   PROFILE SECTION
   ================================================================== */
.profile-section {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
    position: relative;
    z-index: var(--z-base);
}

.profile-image {
    position: relative;
    display: inline-block;
    margin-bottom: var(--spacing-lg);
}

.profile-image img {
    width: 120px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    background-color: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    /* Prevent layout shift */
    aspect-ratio: 1 / 1;
}

.online-badge {
    position: absolute;
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 20px;
    height: 20px;
    background: #10b981;
    border: 3px solid var(--white);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.profile-name {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

.profile-tagline {
    font-size: var(--font-size-lg);
    color: var(--white);
    opacity: 0.95;
    margin-bottom: var(--spacing-xs);
}

.profile-bio {
    font-size: var(--font-size-sm);
    color: var(--white);
    opacity: 0.85;
}

/* ===================================================================
   SOCIAL STATS (If needed)
   ================================================================== */
.social-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--white);
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--white);
    opacity: 0.8;
}

/* ===================================================================
   MAIN CONTENT SECTION
   ================================================================== */
.links-section {
    position: relative;
    z-index: var(--z-base);
    padding-bottom: var(--spacing-xl);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-xl) 0 var(--spacing-md);
}

.section-title .icon {
    font-size: var(--font-size-2xl);
}

.section-title h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================================================
   BRANCHES SECTION
   ================================================================== */
.branches-intro {
    text-align: center;
    color: var(--white);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
    padding: 0 var(--spacing-md);
}

/* City Groups */
.city-group {
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--white);
    /* Performance optimization */
    transform: translateZ(0);
}

.city-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    background: var(--white);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    cursor: pointer;
    transition: all var(--duration-base) ease;
    text-align: right;
    font-family: var(--font-family);
    /* Improve tap target size */
    min-height: 48px;
}

.city-header:hover {
    background: var(--light-bg);
    transform: translateX(-2px);
}

.city-header:active {
    transform: scale(0.98);
}

.city-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.city-name {
    flex: 1;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: #2d3748;
    text-align: right;
}

.branch-count {
    font-size: var(--font-size-xs);
    color: #4a5568;
    background: #f3e8ff;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.city-arrow {
    color: var(--light-text);
    transition: transform var(--duration-base) ease;
    font-size: var(--font-size-base);
}

.city-arrow.rotated {
    transform: rotate(180deg);
}

/* City Branches Container */
.city-branches {
    max-height: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    transition: max-height var(--duration-slow) ease;
}

.city-branches.open {
    max-height: 10000px;
    overflow-y: auto;
    /* Smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
}

/* Individual Branch Items */
.branch-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    text-decoration: none;
    color: #2d3748;
    border-top: 1px solid var(--border-color);
    transition: all var(--duration-base) ease;
    /* Improve tap target size */
    min-height: 48px;
    background: transparent;
}

.branch-item:first-child {
    border-top: none;
}

.branch-item:hover {
    background: var(--light-bg);
    padding-right: calc(var(--spacing-lg) + 5px);
}

.branch-item:active {
    background: rgba(233, 30, 99, 0.1);
}

.branch-item > i:first-child {
    color: var(--primary-color);
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

.branch-info {
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
}

.branch-name {
    display: block;
    font-weight: 500;
    font-size: var(--font-size-base);
    color: #2d3748;
    /* Handle long text */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-phone {
    display: block;
    font-size: var(--font-size-sm);
    color: #4a5568;
    margin-top: var(--spacing-xs);
    /* Handle long text */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-item > i:last-child {
    color: var(--primary-color);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

/* ===================================================================
   FOOTER
   ================================================================== */
.footer {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    color: var(--white);
    opacity: 0.8;
    font-size: var(--font-size-sm);
    position: relative;
    z-index: var(--z-base);
}

.footer p {
    margin: var(--spacing-xs) 0;
}

.footer-version {
    font-size: var(--font-size-xs);
    opacity: 0.6;
}

/* ===================================================================
   LOADING OVERLAY
   ================================================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================================================
   NOTIFICATIONS
   ================================================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    max-width: 400px;
    margin: 0 auto;
    padding: var(--spacing-md);
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100px);
    opacity: 0;
    transition: all var(--duration-base) ease;
    z-index: var(--z-notification);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.error-notification {
    background: #fee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

.success-notification {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

/* ===================================================================
   RESPONSIVE DESIGN - TABLET (768px+)
   ================================================================== */
@media (min-width: 768px) {
    .container {
        padding: var(--spacing-lg);
    }

    .profile-image img {
        width: 150px;
    }

    .profile-name {
        font-size: var(--font-size-3xl);
    }

    .city-header {
        padding: var(--spacing-lg) var(--spacing-xl);
    }

    .branch-item {
        padding: var(--spacing-lg) var(--spacing-xl);
    }

    .branch-item:hover {
        padding-right: calc(var(--spacing-xl) + 10px);
    }
}

/* ===================================================================
   RESPONSIVE DESIGN - DESKTOP (1024px+)
   ================================================================== */
@media (min-width: 1024px) {
    .container {
        max-width: 600px;
    }

    .profile-section {
        padding: 50px var(--spacing-xl) var(--spacing-xl);
    }
}

/* ===================================================================
   RESPONSIVE DESIGN - LARGE DESKTOP (1440px+)
   ================================================================== */
@media (min-width: 1440px) {
    .container {
        max-width: 700px;
    }
}

/* ===================================================================
   PRINT STYLES
   ================================================================== */
@media print {
    body {
        background: white;
    }

    .bg-animation,
    .confetti,
    .loading-overlay,
    .notification {
        display: none !important;
    }

    .container {
        max-width: 100%;
    }

    .branch-item {
        page-break-inside: avoid;
    }
}

/* ===================================================================
   HIGH CONTRAST MODE SUPPORT
   ================================================================== */
@media (prefers-contrast: high) {
    .city-header,
    .branch-item {
        border: 2px solid currentColor;
    }

    .branch-item {
        border-top-width: 1px;
    }
}

/* ===================================================================
   DARK MODE SUPPORT (Optional)
   ================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-text: #f7fafc;
        --light-text: #cbd5e0;
        --border-color: #4a5568;
    }

    .city-header,
    .city-branches,
    .branch-item {
        background: rgba(255, 255, 255, 0.95);
    }

    .city-header:hover,
    .branch-item:hover {
        background: rgba(252, 228, 236, 0.95);
    }
}
