/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent SVGs from overflowing their containers */
svg {
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}

/* Service logo SVGs - ensure consistent sizing */
.service-logo-svg,
.service-icon svg,
.integration-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    max-width: 1.5rem;
    max-height: 1.5rem;
    flex-shrink: 0;
}

/* View Transitions API - Smooth page transitions */
@view-transition {
    navigation: auto;
}

/* Customize the view transition animation */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Specific transition for chat input morphing */
::view-transition-old(chat-input-morph),
::view-transition-new(chat-input-morph) {
    animation-duration: 0.6s;
    mix-blend-mode: normal;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    overscroll-behavior-y: auto;
    /* Solid background color that matches gradient start for bounce area */
    background: #0f172a;
    min-height: 100%;
    height: 100%;
}

html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #475569 75%, #64748b 100%);
    z-index: -1;
    pointer-events: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #ffffff;
    background: transparent;
    min-height: 100vh;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Performance optimizations for all animated/transformed elements */
[class*="card"],
[class*="btn"],
[class*="dropdown"],
[class*="modal"],
[class*="signal"],
[class*="insight"],
[class*="traffic"],
[class*="channel"],
[class*="customer"],
[class*="mrr"],
[class*="realtime"],
[class*="seo"],
[class*="nav"],
[class*="project"],
[class*="user"],
[class*="glass"],
[class*="dashboard"],
[class*="pricing"],
[class*="magic"],
[class*="comparison"],
[class*="result"],
[class*="highlight"] {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Optimize elements that use hover transforms */
.btn,
.btn-primary,
.btn-secondary,
.glass-card,
.signal-card,
.dashboard-mini-card,
.pricing-card,
.customer-item,
.insight-item,
.highlight-item,
.minimal-channel-row,
.project-dropdown-item,
.dropdown-item,
.nav-tab {
    will-change: transform;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Optimize dropdowns and modals */
.project-dropdown,
.user-dropdown,
.share-modal-overlay,
#shareModal {
    will-change: opacity, visibility, transform;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Enhanced Color palette */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    --white: #ffffff;
    --black: #000000;
}

/* Utility Classes */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 2rem; 
}

.text-center { text-align: center; }
.text-light { color: var(--slate-300); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.grid-2 { 
    grid-template-columns: repeat(2, 1fr); 
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--slate-400); }

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #60a5fa 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo img {
    margin-bottom: 5px;
}

.hero-logo, .logo-svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-bottom: 0.1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.25);
}

/* Make plus icon in primary button brighter */
.btn-primary::first-line {
    filter: brightness(1.2);
    font-weight: 700;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.35);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Glass Card */
.glass-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .container { padding: 0 1.5rem; }
    
    /* Header mobile improvements */
    .header-content {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Add padding to cards on mobile */
    .glass-card {
        padding: 1.5rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    /* Grid and layout adjustments */
    .grid-2 { grid-template-columns: 1fr; gap: 2rem; }
    .grid-3 { grid-template-columns: 1fr; }
    .flex { flex-direction: column; }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .gap-6 { gap: 1rem; }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* Landscape orientation fixes for mobile - applies to all pages */
@media (max-width: 932px) and (orientation: landscape) {
    html {
        width: 100vw;
        overflow-x: hidden;
    }

    body {
        width: 100vw;
        overflow-x: hidden;
        min-width: 100vw;
    }

    .container {
        padding: 0.5rem;
        width: 100%;
        max-width: 100% !important;
        padding-left: calc(0.5rem + env(safe-area-inset-left));
        padding-right: calc(0.5rem + env(safe-area-inset-right));
    }
}

/* ========================================
   Confirmation Dialog (Reusable Component)
   ======================================== */
.confirm-dialog-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.confirm-dialog-overlay.show {
    display: flex;
    opacity: 1;
}

.confirm-dialog {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 2rem;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5),
                0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: confirmDialogSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-dialog.danger {
    border-color: rgba(239, 68, 68, 0.3);
}

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

.confirm-dialog-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.confirm-dialog-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.confirm-dialog-icon.warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.confirm-dialog-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.confirm-dialog-icon svg {
    width: 24px;
    height: 24px;
}

.confirm-dialog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    margin: 0 0 0.75rem 0;
}

.confirm-dialog-message {
    color: var(--slate-400);
    font-size: 0.9375rem;
    line-height: 1.6;
    text-align: center;
    margin: 0 0 1.75rem 0;
}

.confirm-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-dialog-btn {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-dialog-btn-cancel {
    background: rgba(100, 116, 139, 0.2);
    color: white;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.confirm-dialog-btn-cancel:hover {
    background: rgba(100, 116, 139, 0.3);
    border-color: rgba(148, 163, 184, 0.4);
}

.confirm-dialog-btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

.confirm-dialog-btn-confirm:hover {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.confirm-dialog-btn-confirm.danger {
    background: rgba(239, 68, 68, 0.9);
}

.confirm-dialog-btn-confirm.danger:hover {
    background: rgba(239, 68, 68, 1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@media (max-width: 480px) {
    .confirm-dialog {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 1rem;
    }

    .confirm-dialog-actions {
        flex-direction: column-reverse;
    }

    .confirm-dialog-btn {
        width: 100%;
    }
}

