:root {
    --primary: 210 79% 46%;
    --primary-foreground: 0 0% 98%;
    --secondary: 210 11% 71%;
    --secondary-foreground: 210 11% 20%;
    --background: 210 11% 98%;
    --foreground: 210 11% 3%;
    --muted: 210 11% 95%;
    --muted-foreground: 210 11% 45%;
    --border: 210 11% 89%;
    --success: 142 69% 58%;
    --warning: 38 92% 50%;
    --danger: 0 84% 60%;
}

body {
    background-color: #f7f7f8;
    color: #111;
    font-family: 'Inter', sans-serif;
}

/* Header styling - force override */
header.site-header,
.site-header {
    background: #f5f5f6 !important;
    background-color: #f5f5f6 !important;
    color: #1a1a1a !important;
    display: flex !important;
    align-items: center;
    gap: 24px;
    padding: 24px 40px;
    margin-left: 250px;
    border-radius: 0;
    margin-bottom: 0;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .site-header {
        margin-left: 0 !important;
        padding: 16px 20px !important;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .site-header img.logo {
        width: 120px !important;
    }
    
    .site-header h1 {
        font-size: 1.2rem !important;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 10px;
    }
    
    /* Mobile dashboard cards */
    .stats-cards .col-md-3 {
        margin-bottom: 15px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    /* Mobile forms */
    .form-control, .btn {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .upload-area {
        padding: 20px 10px;
        min-height: 120px;
    }
    
    /* Mobile navigation */
    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1050;
        background: #FF5C5C;
        color: white;
        border: none;
        padding: 10px 12px;
        border-radius: 5px;
        font-size: 18px;
    }
    
    /* Hide desktop refresh button on mobile */
    .site-header .btn-ghost {
        display: none;
    }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .site-header {
        margin-left: 200px !important;
        padding: 20px 30px !important;
    }
    
    .site-header img.logo {
        width: 150px !important;
    }
    
    .sidebar {
        width: 200px;
    }
}

/* Desktop and larger screens */
@media (min-width: 769px) {
    .mobile-nav-toggle {
        display: none;
    }
}

.site-header img.logo { 
    width: 180px; 
    height: auto; 
}

.site-header .tagline { 
    font-size: 1.125rem; 
    line-height: 1.4; 
    margin: 0;
    color: #f7f7f8;
    opacity: 0.8;
}

h1, h2, h3 { 
    font-family: 'Poppins', sans-serif; 
}

.sidebar nav a.active{
  background:#FF5C5C;
  color:#fff;
}

.btn-ghost{
  border:none;
  background:transparent;
  color:var(--electric-coral);
  font-size:1.3rem;
  padding:4px 6px;
}
.btn-ghost:hover{opacity:.75;}

/* Enhanced logo styling following brand guidelines */
.logo {
    width: 180px;
    height: auto;
    transition: all 0.3s ease;
    object-fit: contain;
    /* Enhance visibility on dark header */
    filter: brightness(1.2) contrast(1.1);
    border-radius: 8px;
}

.logo:hover {
    filter: brightness(1.3) contrast(1.15);
    transform: scale(1.02);
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: hsl(var(--primary));
    background-color: hsl(var(--muted));
}

.sidebar .nav-link.active {
    color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
    border-radius: 6px;
}

.content-section {
    animation: fadeIn 0.3s ease-in-out;
}

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

.card {
    border: 1px solid hsl(var(--border));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-card {
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.video-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.video-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.job-card {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.job-card.status-pending {
    border-left-color: hsl(var(--secondary));
}

.job-card.status-processing {
    border-left-color: hsl(var(--warning));
}

.job-card.status-completed {
    border-left-color: hsl(var(--success));
}

.job-card.status-failed {
    border-left-color: hsl(var(--danger));
}

.job-card.status-cancelled {
    border-left-color: hsl(var(--muted-foreground));
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background-color: hsl(var(--secondary) / 0.1);
    color: hsl(var(--secondary-foreground));
}

.status-processing {
    background-color: hsl(var(--warning) / 0.1);
    color: hsl(var(--warning));
}

.status-completed {
    background-color: hsl(var(--success) / 0.1);
    color: hsl(var(--success));
}

.status-failed {
    background-color: hsl(var(--danger) / 0.1);
    color: hsl(var(--danger));
}

.status-cancelled {
    background-color: hsl(var(--muted) / 0.5);
    color: hsl(var(--muted-foreground));
}

.step-indicator .step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.step-indicator .step:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 32px;
    height: 32px;
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step-content h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.progress-ring {
    width: 40px;
    height: 40px;
    display: inline-block;
}

.progress-ring-circle {
    stroke: hsl(var(--primary));
    stroke-width: 3;
    fill: transparent;
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.3s ease;
}

.btn {
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.btn:hover {
    transform: translateY(-1px);
}

.form-control, .form-select {
    border: 1px solid hsl(var(--border));
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.alert {
    border-radius: 6px;
    border: none;
}

.alert-info {
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
}

.alert-success {
    background-color: hsl(var(--success) / 0.1);
    color: hsl(var(--success));
}

.alert-warning {
    background-color: hsl(var(--warning) / 0.1);
    color: hsl(var(--warning));
}

.alert-danger {
    background-color: hsl(var(--danger) / 0.1);
    color: hsl(var(--danger));
}

.loading-skeleton {
    background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--muted) / 0.5) 50%, hsl(var(--muted)) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        height: auto;
        padding: 0;
    }
    
    .video-card {
        padding: 0.75rem;
    }
    
    .step-indicator .step {
        margin-bottom: 1rem;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--muted));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground) / 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground) / 0.5);
}

/* ===============================================
   ADVANCED MOBILE OPTIMIZATIONS FOR HOOKSY STUDIO
   =============================================== */

/* Progressive Web App Support */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Base mobile styles */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevents zoom on iOS */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hero section mobile optimization */
    .hero-section {
        min-height: auto;
        padding: 3rem 0 4rem 0;
    }
    
    .hero-section h1 {
        font-size: 2.2rem !important;
        line-height: 1.1;
        margin-bottom: 1.5rem;
        font-weight: 700;
    }
    
    .hero-section .lead {
        font-size: 1.2rem;
        margin-bottom: 3rem;
        font-weight: 400;
        opacity: 0.9;
    }
    
    .hero-section img {
        max-height: 100px;
        margin-bottom: 2rem;
    }
    
    /* Mobile button optimization */
    .btn-lg {
        font-size: 1.1rem;
        padding: 1rem 2rem;
        margin-bottom: 1rem;
        width: 100%;
        display: block;
        border-radius: 50px;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    
    .btn-lg:last-child {
        margin-bottom: 0;
    }
    
    .btn-lg:active {
        transform: translateY(2px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    /* Platform cards mobile - enhanced for touch */
    .platform-card {
        margin-bottom: 1.5rem;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        border-radius: 1rem;
        border: 2px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        will-change: transform;
        position: relative;
        overflow: hidden;
    }
    
    .platform-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
        opacity: 0;
        transition: opacity 0.3s ease;
        border-radius: inherit;
    }
    
    .platform-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .platform-card:active {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    }
    
    .platform-card .card-body {
        padding: 2rem 1.5rem;
        text-align: center;
    }
    
    .platform-card .fas {
        font-size: 3rem;
        margin-bottom: 1.5rem;
        color: rgba(255, 255, 255, 0.9);
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .platform-card .card-title {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
        font-weight: 600;
        color: white;
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    }
    
    .platform-card .card-text {
        font-size: 0.95rem;
        opacity: 0.9;
        color: rgba(255, 255, 255, 0.8);
    }
    
    /* Navbar mobile */
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem !important;
    }
    
    .navbar-nav {
        text-align: center;
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Modal mobile optimization */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    /* Form elements mobile */
    .form-control, .form-select, .btn {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
    
    /* Table mobile optimization */
    .table-responsive {
        font-size: 0.9rem;
        border-radius: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th, .table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    /* Card mobile optimization */
    .card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .card-header {
        padding: 1rem;
        border-radius: 0.75rem 0.75rem 0 0;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Footer mobile */
    footer {
        margin-top: 3rem;
        padding: 2rem 0 !important;
    }
    
    .footer-links {
        text-align: center !important;
        margin-top: 1rem;
    }
    
    .footer-links a {
        display: inline-block;
        margin: 0.5rem 1rem;
        font-size: 1rem;
        padding: 0.5rem;
        min-height: 44px;
        line-height: 1.5;
    }
    
    /* Add better spacing for platform selection */
    .platform-selection {
        padding: 2rem 0;
    }
    
    .platform-selection h2 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
        font-weight: 600;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .platform-card .fas {
        font-size: 2rem;
    }
    
    /* Pricing cards mobile */
    .pricing-card {
        margin-bottom: 2rem;
    }
    
    .pricing-card .card-header h3 {
        font-size: 1.5rem;
    }
    
    .pricing-card .display-4 {
        font-size: 2.5rem;
    }
    
    /* API keys table mobile */
    .api-keys-table {
        font-size: 0.8rem;
    }
    
    .api-keys-table .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Navigation collapse */
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        margin-top: 0.5rem;
        border-radius: 0.5rem;
        padding: 1rem;
    }
}

/* Advanced touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn, .platform-card, .nav-link {
        min-height: 48px; /* Enhanced touch target size */
        position: relative;
    }
    
    /* Remove hover effects on touch devices */
    .platform-card:hover {
        transform: none;
        box-shadow: inherit;
    }
    
    /* Enhanced touch feedback */
    .platform-card:active {
        transform: scale(0.97);
        transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        filter: brightness(1.1);
    }
    
    .platform-card:active::before {
        opacity: 1;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.97);
        transition: transform 0.15s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    /* Touch ripple effect */
    .platform-card::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease;
        pointer-events: none;
    }
    
    .platform-card:active::after {
        width: 100px;
        height: 100px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 1rem 0;
        min-height: auto;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .hero-section {
        min-height: -webkit-fill-available;
    }
    
    .modal-dialog {
        margin-top: env(safe-area-inset-top, 1rem);
        margin-bottom: env(safe-area-inset-bottom, 1rem);
    }
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
    /* GPU acceleration for smooth animations */
    .platform-card, .btn-lg, .modal, .navbar {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    /* Optimize scrolling performance */
    .modal-body, .container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Reduce repaints and reflows */
    .platform-card {
        contain: layout style paint;
    }
    
    /* Optimize font rendering */
    body, .btn, .platform-card {
        text-rendering: optimizeSpeed;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Battery-friendly animations */
    @media (prefers-reduced-motion: reduce) {
        .platform-card, .btn-lg {
            transition: none;
            animation: none;
        }
    }
}

/* Advanced mobile navigation */
@media (max-width: 768px) {
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
        font-size: 1.5rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0.5rem;
        backdrop-filter: blur(10px);
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
        outline: none;
    }
    
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        margin-top: 1rem;
        border-radius: 1rem;
        padding: 1.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
}

/* Enhanced mobile form interactions */
@media (max-width: 768px) {
    .form-control, .form-select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 1rem;
        border-radius: 0.75rem;
        border: 2px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.9);
        transition: all 0.3s ease;
    }
    
    .form-control:focus, .form-select:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.25);
        background: white;
        transform: translateY(-2px);
    }
    
    /* Mobile-optimized modal */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    .modal-content {
        border-radius: 1rem;
        border: none;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(20px);
    }
    
    .modal-header {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .navbar-collapse {
        background: rgba(33, 37, 41, 0.95);
        color: white;
    }
    
    .card {
        background-color: #2d3748;
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .modal-content {
        background-color: #2d3748;
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .form-control, .form-select {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .form-control:focus, .form-select:focus {
        background: rgba(255, 255, 255, 0.15);
        border-color: #667eea;
    }
}
