/**
 * LiveNow Link-in-Bio - Unified CSS
 * Complete responsive stylesheet for mobile and desktop
 * Version: 2.0 - Refactored and optimized
 */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    /* Color Scheme - Cyan Teal Theme */
    --color-bg-primary: #042D2D;
    --color-bg-secondary: #2a7a7a;
    --color-bg-overlay: rgba(0, 255, 255, 0.1);
    --color-text-primary: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.8);
    --color-text-muted: rgba(255, 255, 255, 0.6);
    --color-accent-primary: #00FFFF;
    --color-accent-secondary: #40E0D0;
    --color-border-light: rgba(0, 255, 255, 0.2);
    --color-border-medium: rgba(0, 255, 255, 0.4);
    
    /* Spacing System */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Typography Scale */
    --text-xs: 10px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 24px;
    
    /* Layout Constants */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
    
    /* Transitions */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-Index Scale */
    --z-base: 1;
    --z-elevated: 10;
    --z-overlay: 100;
    --z-modal: 1000;
    --z-tooltip: 10000;
}

/* ===== RESET & BASE STYLES ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    background: linear-gradient(135deg, #042D2D 0%, #2a7a7a 35%, #00FFFF 70%, #042D2D 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    position: relative;
}



@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 0%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* ===== LAYOUT COMPONENTS ===== */

/* Main Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-md);
    background: transparent;
}

/* Header Section */
.header {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-lg) 0;
    position: relative;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 255, 255, 0.4));
    transition: var(--transition-normal);
}

.logo:hover {
    filter: drop-shadow(0 6px 12px rgba(0, 255, 255, 0.6));
    transform: scale(1.02);
}

/* Refresh Button */
.refresh-button {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 255, 255, 0.15);
    border: 1px solid var(--color-border-light);
    border-radius: 50%;
    color: var(--color-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-elevated);
}

.refresh-button i {
    font-size: var(--text-lg);
    transition: var(--transition-normal);
}

.refresh-button:hover {
    transform: translateY(-50%) scale(1.1);
    background: rgba(0, 255, 255, 0.25);
    border-color: var(--color-accent-primary);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.4);
}

.refresh-button:hover i {
    color: var(--color-accent-primary);
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.8));
    transform: rotate(180deg);
}

.refresh-button:active {
    transform: translateY(-50%) scale(0.95);
}

.refresh-button:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-lg) 0;
    min-height: 0;
    background: transparent;
}

/* ===== APP GRID SYSTEM ===== */

/* Grid Container */
.app-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: var(--space-lg);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    justify-content: center;
    align-items: start;
    background: transparent;
    backdrop-filter: none;
}

/* Desktop Grid Layout */
@media (min-width: 768px) {
    .app-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
        max-width: 600px;
        gap: var(--space-lg);
        width: 100%;
    }
}

/* App Items */
.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    opacity: 1;
    animation: fadeInUp var(--transition-slow) ease-out forwards;
}

/* Staggered Animation Delays */
.app-item:nth-child(1) { animation-delay: 0.1s; }
.app-item:nth-child(2) { animation-delay: 0.15s; }
.app-item:nth-child(3) { animation-delay: 0.2s; }
.app-item:nth-child(4) { animation-delay: 0.25s; }
.app-item:nth-child(5) { animation-delay: 0.3s; }
.app-item:nth-child(6) { animation-delay: 0.35s; }
.app-item:nth-child(7) { animation-delay: 0.4s; }
.app-item:nth-child(8) { animation-delay: 0.45s; }
.app-item:nth-child(9) { animation-delay: 0.5s; }
.app-item:nth-child(10) { animation-delay: 0.55s; }
.app-item:nth-child(11) { animation-delay: 0.6s; }

/* App Buttons */
.app-button {
    position: relative;
    display: block;
    width: 85px;
    height: 85px;
    text-decoration: none;
    border-radius: 18px;
    overflow: hidden;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transform-origin: center;
}

.app-icon {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 18px;
    transition: var(--transition-normal);
}

/* Button Interactions */
.app-button:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.app-button:hover .app-icon {
    filter: brightness(1.1) contrast(1.05);
}

.app-button:active {
    transform: translateY(-3px) scale(1.02);
    transition: var(--transition-fast);
}

.app-button.clicked {
    transform: scale(0.95);
    transition: var(--transition-fast);
}

/* Coming Soon Ribbon */
.coming-soon-ribbon {
    position: absolute;
    top: 6px;
    right: -20px;
    background: linear-gradient(45deg, #ef4444, #f87171);
    color: white;
    padding: 2px 6px;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transform: rotate(45deg);
    transform-origin: center;
    z-index: var(--z-elevated);
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    line-height: 1;
}





/* App Labels */
.app-label {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-primary);
    text-align: center;
    letter-spacing: -0.24px;
    line-height: 1.2;
    max-width: 90px;
    word-wrap: break-word;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* ===== FOOTER COMPONENTS ===== */

.footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    margin-top: auto;
}

/* Social Media Section */
.social-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-links {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(0, 255, 255, 0.15);
    border: 1px solid var(--color-border-light);
    border-radius: 50%;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.social-link i {
    font-size: var(--text-lg);
    transition: var(--transition-normal);
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    background: rgba(0, 255, 255, 0.25);
    border-color: var(--color-accent-primary);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.4);
}

.social-link:hover i {
    color: var(--color-accent-primary);
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.8));
}

/* Copyright */
.copyright {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 1.5;
}

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

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

/* Fallback for animation issues */
.app-item {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* ===== UTILITY CLASSES ===== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-scroll {
    overflow: hidden;
}

/* Hide mobile dock by default (desktop/tablet) */
.mobile-dock {
    display: none;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Mobile Devices (up to 768px) */
@media (max-width: 768px) {
    :root {
        --space-lg: 16px;
        --space-xl: 24px;
    }
    
    .container {
        padding: var(--space-sm);
        padding-bottom: 120px; /* Space for dock */
    }
    
    .header {
        padding: var(--space-md) 0 var(--space-xs) 0;
    }
    
    .logo {
        height: 60px;
    }
    
    .refresh-button {
        width: 36px;
        height: 36px;
        right: var(--space-sm);
    }
    
    .refresh-button i {
        font-size: var(--text-base);
    }
    
    .main-content {
        padding: var(--space-xs) 0;
    }
    
    .app-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        max-width: 100%;
        padding: 0 var(--space-md);
    }
    
    .app-button {
        width: 80px;
        height: 80px;
    }
    
    .app-button:hover {
        transform: translateY(-4px) scale(1.03);
    }
    
    .coming-soon-ribbon {
        font-size: 7px;
        padding: 1px 4px;
        right: -18px;
        top: 5px;
    }
    
    .app-label {
        font-size: 12px;
        font-weight: 400;
        max-width: 80px;
        letter-spacing: -0.24px;
        line-height: 1.2;
    }
    
    /* Show social media buttons on mobile */
    .social-container {
        display: flex;
        margin: var(--space-md) 0;
    }
    
    .social-links {
        gap: var(--space-md);
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .social-link i {
        font-size: var(--text-base);
    }
    
    .footer {
        padding: var(--space-md) 0;
        gap: var(--space-sm);
    }
    
    /* Mobile Dock Styles */
    .mobile-dock {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: var(--z-modal);
        padding: 12px 20px 34px 20px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dock-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 400px;
        margin: 0 auto;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 32px;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    .dock-item {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .dock-button {
        display: block;
        text-decoration: none;
        transition: var(--transition-normal);
        transform-origin: center bottom;
    }
    
    .dock-button:active {
        transform: scale(0.9);
    }
    
    .dock-icon {
        width: 64px;
        height: 64px;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        transition: var(--transition-normal);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    /* Apple Phone Icon */
    .apple-phone-icon {
        background: linear-gradient(135deg, #4CAF50, #45a049);
    }
    
    .apple-phone-icon i {
        font-size: 28px;
        color: white;
    }
    
    /* Apple Mail Icon */
    .apple-mail-icon {
        background: linear-gradient(135deg, #0EA5E9, #0284C7);
        position: relative;
    }
    
    .apple-mail-icon i {
        font-size: 26px;
        color: white;
    }
    
    /* Apple Safari Icon */
    .apple-safari-icon {
        background: linear-gradient(135deg, #0EA5E9, #3B82F6);
        position: relative;
    }
    
    .apple-safari-icon i {
        font-size: 26px;
        color: white;
    }
    
    /* Apple Messages Icon */
    .apple-messages-icon {
        background: linear-gradient(135deg, #10B981, #059669);
        position: relative;
    }
    
    .apple-messages-icon i {
        font-size: 26px;
        color: white;
    }
}

/* Small Mobile Devices (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: var(--space-xs);
        padding-bottom: 120px; /* Space for dock */
    }
    
    .header {
        padding: var(--space-sm) 0 2px 0;
    }
    
    .main-content {
        padding: 2px 0;
    }
    
    .refresh-button {
        width: 32px;
        height: 32px;
        right: var(--space-xs);
    }
    
    .refresh-button i {
        font-size: var(--text-sm);
    }
    
    .app-grid {
        gap: var(--space-sm);
    }
    
    .app-button {
        width: 70px;
        height: 70px;
    }
    
    .app-label {
        font-size: 11px;
        font-weight: 400;
        max-width: 70px;
        letter-spacing: -0.20px;
        line-height: 1.2;
    }
    
    /* Dock adjustments for small screens */
    .dock-container {
        padding: 6px 12px;
        max-width: 340px;
    }
    
    .dock-icon {
        width: 56px;
        height: 56px;
    }
    
    .apple-phone-icon i,
    .apple-mail-icon i,
    .apple-safari-icon i,
    .apple-messages-icon i {
        font-size: 22px;
    }
}

/* Tablet Devices (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: var(--space-lg);
        max-width: 600px;
    }
    
    .app-grid {
        max-width: 420px;
        gap: var(--space-lg);
    }
    
    .app-button {
        width: 90px;
        height: 90px;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .social-link i {
        font-size: var(--text-base);
    }
    
    .social-links {
        gap: var(--space-md);
    }
}

/* Desktop Devices (1025px and up) */
@media (min-width: 1025px) {
    .container {
        padding: var(--space-xl);
        max-width: 800px;
    }
    
    .header {
        padding: var(--space-2xl) 0;
    }
    
    .logo {
        height: 100px;
    }
    
    .main-content {
        padding: var(--space-2xl) 0;
    }
    
    .app-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: var(--space-xl);
        max-width: 600px;
        justify-items: center;
    }
    
    /* Desktop Grid Layout - 11 buttons in 4x3 grid */
    .app-item:nth-child(1) { grid-column: 1; grid-row: 1; }
    .app-item:nth-child(2) { grid-column: 2; grid-row: 1; }
    .app-item:nth-child(3) { grid-column: 3; grid-row: 1; }
    .app-item:nth-child(4) { grid-column: 1; grid-row: 2; }
    .app-item:nth-child(5) { grid-column: 2; grid-row: 2; }
    .app-item:nth-child(6) { grid-column: 3; grid-row: 2; }
    .app-item:nth-child(7) { grid-column: 4; grid-row: 2; }
    .app-item:nth-child(8) { grid-column: 1; grid-row: 3; }
    .app-item:nth-child(9) { grid-column: 2; grid-row: 3; }
    .app-item:nth-child(10) { grid-column: 3; grid-row: 3; }
    .app-item:nth-child(11) { grid-column: 4; grid-row: 3; }
    
    .app-button {
        width: 100px;
        height: 100px;
    }
    
    .app-button:hover {
        transform: translateY(-8px) scale(1.06);
    }
    
    .coming-soon-ribbon {
        font-size: var(--text-xs);
        padding: 3px 8px;
        right: -22px;
        top: 7px;
    }
    
    .app-label {
        font-size: var(--text-base);
        max-width: 100px;
    }
    
    .social-link {
        width: 48px;
        height: 48px;
    }
    
    .social-link i {
        font-size: var(--text-lg);
    }
    
    .social-links {
        gap: var(--space-lg);
    }
    
    .footer {
        padding: var(--space-2xl) 0;
    }
}

/* Large Desktop (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 900px;
    }
    
    .app-grid {
        max-width: 700px;
        gap: var(--space-2xl);
    }
    
    .app-button {
        width: 110px;
        height: 110px;
    }
    
    .app-label {
        font-size: var(--text-lg);
        max-width: 110px;
    }
}

/* ===== ACCESSIBILITY & INTERACTION STATES ===== */

/* Focus States */
.app-button:focus,
.social-link:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .app-item {
        animation: none !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

/* Force visible items */
.app-item,
.app-button,
.app-icon {
    opacity: 1 !important;
    visibility: visible !important;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --color-border-light: rgba(0, 0, 0, 0.3);
        --color-border-medium: rgba(0, 0, 0, 0.5);
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode variables would go here */
}

/* ===== PRINT STYLES ===== */
@media print {
    .social-container,
    .coming-soon-ribbon {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .app-button {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}