/* Tailwind-inspired Theme Variables */
:root {
  --background: rgb(248, 247, 250);
  --foreground: rgb(61, 60, 79);
  --card: rgb(255, 255, 255);
  --card-foreground: rgb(61, 60, 79);
  --popover: rgb(255, 255, 255);
  --popover-foreground: rgb(61, 60, 79);
  --primary: rgb(138, 121, 171);
  --primary-foreground: rgb(248, 247, 250);
  --secondary: rgb(223, 217, 236);
  --secondary-foreground: rgb(61, 60, 79);
  --muted: rgb(220, 217, 227);
  --muted-foreground: rgb(107, 104, 128);
  --accent: rgb(230, 165, 184);
  --accent-foreground: rgb(75, 46, 54);
  --destructive: rgb(217, 92, 92);
  --destructive-foreground: rgb(248, 247, 250);
  --border: rgb(206, 201, 217);
  --input: rgb(234, 231, 240);
  --ring: rgb(138, 121, 171);
  --chart-1: rgb(138, 121, 171);
  --chart-2: rgb(230, 165, 184);
  --chart-3: rgb(119, 184, 161);
  --chart-4: rgb(240, 200, 141);
  --chart-5: rgb(160, 187, 227);
  --sidebar: rgb(241, 239, 245);
  --sidebar-foreground: rgb(61, 60, 79);
  --sidebar-primary: rgb(138, 121, 171);
  --sidebar-primary-foreground: rgb(248, 247, 250);
  --sidebar-accent: rgb(230, 165, 184);
  --sidebar-accent-foreground: rgb(75, 46, 54);
  --sidebar-border: rgb(215, 210, 224);
  --sidebar-ring: rgb(138, 121, 171);
  --font-sans: 'Inter', 'Geist', sans-serif;
  --font-serif: "Lora", Georgia, serif;
  --font-mono: "Fira Code", "Courier New", monospace;
  --radius: 0.5rem;
  --shadow-2xs: 1px 2px 5px 1px hsl(0 0% 0% / 0.03);
  --shadow-xs: 1px 2px 5px 1px hsl(0 0% 0% / 0.03);
  --shadow-sm: 1px 2px 5px 1px hsl(0 0% 0% / 0.06), 1px 1px 2px 0px hsl(0 0% 0% / 0.06);
  --shadow: 1px 2px 5px 1px hsl(0 0% 0% / 0.06), 1px 1px 2px 0px hsl(0 0% 0% / 0.06);
  --shadow-md: 1px 2px 5px 1px hsl(0 0% 0% / 0.06), 1px 2px 4px 0px hsl(0 0% 0% / 0.06);
  --shadow-lg: 1px 2px 5px 1px hsl(0 0% 0% / 0.06), 1px 4px 6px 0px hsl(0 0% 0% / 0.06);
  --shadow-xl: 1px 2px 5px 1px hsl(0 0% 0% / 0.06), 1px 8px 10px 0px hsl(0 0% 0% / 0.06);
  --shadow-2xl: 1px 2px 5px 1px hsl(0 0% 0% / 0.15);
  --tracking-normal: 0em;
  --spacing: 0.25rem;
  
  /* Custom theme mappings */
  --bg-primary: var(--background);
  --bg-secondary: var(--card);
  --bg-tertiary: var(--muted);
  --bg-card: var(--card);
  --bg-hover: var(--accent);
  --bg-muted: var(--muted);
  --accent-primary: var(--primary);
  --accent-secondary: var(--accent);
  --accent-tertiary: var(--chart-2);
  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --text-muted: var(--muted-foreground);
  --border-color: var(--border);
  --border-subtle: var(--border);
  --success-color: var(--chart-3);
  --warning-color: var(--chart-4);
  --error-color: var(--destructive);
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent));
  --gradient-secondary: linear-gradient(135deg, var(--primary), var(--chart-2));
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--chart-2));
  --gradient-success: linear-gradient(135deg, var(--chart-3), var(--chart-3));
  --gradient-bg: linear-gradient(135deg, var(--background), var(--sidebar));
  --shadow-small: var(--shadow-sm);
  --shadow-medium: var(--shadow-md);
  --shadow-large: var(--shadow-xl);
  --shadow-glow: 0 0 20px rgba(138, 121, 171, 0.2);
  --border-radius: var(--radius);
  --border-radius-large: calc(var(--radius) * 2);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --background: rgb(26, 24, 35);
  --foreground: rgb(224, 221, 239);
  --card: rgb(35, 32, 48);
  --card-foreground: rgb(224, 221, 239);
  --popover: rgb(35, 32, 48);
  --popover-foreground: rgb(224, 221, 239);
  --primary: rgb(169, 149, 201);
  --primary-foreground: rgb(26, 24, 35);
  --secondary: rgb(90, 83, 112);
  --secondary-foreground: rgb(224, 221, 239);
  --muted: rgb(36, 32, 49);
  --muted-foreground: rgb(160, 154, 173);
  --accent: rgb(55, 46, 63);
  --accent-foreground: rgb(242, 184, 198);
  --destructive: rgb(229, 115, 115);
  --destructive-foreground: rgb(26, 24, 35);
  --border: rgb(48, 44, 64);
  --input: rgb(42, 39, 58);
  --ring: rgb(169, 149, 201);
  --chart-1: rgb(169, 149, 201);
  --chart-2: rgb(242, 184, 198);
  --chart-3: rgb(119, 184, 161);
  --chart-4: rgb(240, 200, 141);
  --chart-5: rgb(160, 187, 227);
  --sidebar: rgb(22, 20, 30);
  --sidebar-foreground: rgb(224, 221, 239);
  --sidebar-primary: rgb(169, 149, 201);
  --sidebar-primary-foreground: rgb(26, 24, 35);
  --sidebar-accent: rgb(55, 46, 63);
  --sidebar-accent-foreground: rgb(242, 184, 198);
  --sidebar-border: rgb(42, 39, 58);
  --sidebar-ring: rgb(169, 149, 201);
  
  /* Dark theme custom mappings */
  --bg-primary: var(--background);
  --bg-secondary: var(--card);
  --bg-tertiary: var(--muted);
  --bg-card: var(--card);
  --bg-hover: var(--accent);
  --bg-muted: var(--muted);
  --accent-primary: var(--primary);
  --accent-secondary: var(--accent-foreground);
  --accent-tertiary: var(--chart-2);
  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --text-muted: var(--muted-foreground);
  --border-color: var(--border);
  --border-subtle: var(--border);
  --success-color: var(--chart-3);
  --warning-color: var(--chart-4);
  --error-color: var(--destructive);
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent-foreground));
  --gradient-secondary: linear-gradient(135deg, var(--primary), var(--chart-2));
  --gradient-accent: linear-gradient(135deg, var(--accent-foreground), var(--chart-2));
  --gradient-success: linear-gradient(135deg, var(--chart-3), var(--chart-3));
  --gradient-bg: linear-gradient(135deg, var(--background), var(--sidebar));
  --shadow-glow: 0 0 20px rgba(169, 149, 201, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Comprehensive zoom prevention */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection for inputs and content areas */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

html {
    height: 100%;
    overflow: hidden; /* Prevent scroll on HTML for PC */
    /* Zoom prevention */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    zoom: 1;
    -moz-transform: scale(1);
    -webkit-transform: scale(1);
    transform: scale(1);
}

body {
    font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden; /* Remove scroll for PC */
    height: 100vh; /* Full viewport height */
    width: 100vw; /* Full viewport width */
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 0;
    margin: 0;
    position: relative;
    /* Additional zoom prevention */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    zoom: 1;
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    transform: scale(1);
    -webkit-transform-origin: 0 0;
    -moz-transform-origin: 0 0;
    transform-origin: 0 0;
}

.blank { 
    height: 0; /* Remove blank space for PC */
}

/* Mobile-first approach adjustments */
@media (max-width: 768px) {
    .blank {
        height: 0;
    }
}

@media (max-width: 480px) {
    .blank {
        height: 0;
    }
}

/* Auto dark mode detection */
@media (prefers-color-scheme: dark) {
    :root {
        --background: rgb(26, 24, 35);
        --foreground: rgb(224, 221, 239);
        --card: rgb(35, 32, 48);
        --card-foreground: rgb(224, 221, 239);
        --popover: rgb(35, 32, 48);
        --popover-foreground: rgb(224, 221, 239);
        --primary: rgb(169, 149, 201);
        --primary-foreground: rgb(26, 24, 35);
        --secondary: rgb(90, 83, 112);
        --secondary-foreground: rgb(224, 221, 239);
        --muted: rgb(36, 32, 49);
        --muted-foreground: rgb(160, 154, 173);
        --accent: rgb(55, 46, 63);
        --accent-foreground: rgb(242, 184, 198);
        --destructive: rgb(229, 115, 115);
        --destructive-foreground: rgb(26, 24, 35);
        --border: rgb(48, 44, 64);
        --input: rgb(42, 39, 58);
        --ring: rgb(169, 149, 201);
        --chart-1: rgb(169, 149, 201);
        --chart-2: rgb(242, 184, 198);
        --chart-3: rgb(119, 184, 161);
        --chart-4: rgb(240, 200, 141);
        --chart-5: rgb(160, 187, 227);
        --sidebar: rgb(22, 20, 30);
        --sidebar-foreground: rgb(224, 221, 239);
        --sidebar-primary: rgb(169, 149, 201);
        --sidebar-primary-foreground: rgb(26, 24, 35);
        --sidebar-accent: rgb(55, 46, 63);
        --sidebar-accent-foreground: rgb(242, 184, 198);
        --sidebar-border: rgb(42, 39, 58);
        --sidebar-ring: rgb(169, 149, 201);
        
        /* Dark theme custom mappings */
        --bg-primary: var(--background);
        --bg-secondary: var(--card);
        --bg-tertiary: var(--muted);
        --bg-card: var(--card);
        --bg-hover: var(--accent);
        --bg-muted: var(--muted);
        --accent-primary: var(--primary);
        --accent-secondary: var(--accent-foreground);
        --accent-tertiary: var(--chart-2);
        --text-primary: var(--foreground);
        --text-secondary: var(--muted-foreground);
        --text-muted: var(--muted-foreground);
        --border-color: var(--border);
        --border-subtle: var(--border);
        --success-color: var(--chart-3);
        --warning-color: var(--chart-4);
        --error-color: var(--destructive);
        --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent-foreground));
        --gradient-secondary: linear-gradient(135deg, var(--primary), var(--chart-2));
        --gradient-accent: linear-gradient(135deg, var(--accent-foreground), var(--chart-2));
        --gradient-success: linear-gradient(135deg, var(--chart-3), var(--chart-3));
        --gradient-bg: linear-gradient(135deg, var(--background), var(--sidebar));
        --shadow-glow: 0 0 20px rgba(169, 149, 201, 0.3);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: block;
    text-align: center;
    padding: 0;
    margin: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.blank { 
    height: 300px;
}

/* Mobile-first approach adjustments */
@media (max-width: 768px) {
    .blank {
        height: 0;
    }
}

@media (max-width: 480px) {
    .blank {
        height: 0;
    }
}

/* Auto dark mode detection */
@media (prefers-color-scheme: dark) {
    :root {
        --background: rgb(26, 24, 35);
        --foreground: rgb(224, 221, 239);
        --card: rgb(35, 32, 48);
        --card-foreground: rgb(224, 221, 239);
        --popover: rgb(35, 32, 48);
        --popover-foreground: rgb(224, 221, 239);
        --primary: rgb(169, 149, 201);
        --primary-foreground: rgb(26, 24, 35);
        --secondary: rgb(90, 83, 112);
        --secondary-foreground: rgb(224, 221, 239);
        --muted: rgb(36, 32, 49);
        --muted-foreground: rgb(160, 154, 173);
        --accent: rgb(55, 46, 63);
        --accent-foreground: rgb(242, 184, 198);
        --destructive: rgb(229, 115, 115);
        --destructive-foreground: rgb(26, 24, 35);
        --border: rgb(48, 44, 64);
        --input: rgb(42, 39, 58);
        --ring: rgb(169, 149, 201);
        --chart-1: rgb(169, 149, 201);
        --chart-2: rgb(242, 184, 198);
        --chart-3: rgb(119, 184, 161);
        --chart-4: rgb(240, 200, 141);
        --chart-5: rgb(160, 187, 227);
        --sidebar: rgb(22, 20, 30);
        --sidebar-foreground: rgb(224, 221, 239);
        --sidebar-primary: rgb(169, 149, 201);
        --sidebar-primary-foreground: rgb(26, 24, 35);
        --sidebar-accent: rgb(55, 46, 63);
        --sidebar-accent-foreground: rgb(242, 184, 198);
        --sidebar-border: rgb(42, 39, 58);
        --sidebar-ring: rgb(169, 149, 201);
        
        /* Dark theme custom mappings */
        --bg-primary: var(--background);
        --bg-secondary: var(--card);
        --bg-tertiary: var(--muted);
        --bg-card: var(--card);
        --bg-hover: var(--accent);
        --bg-muted: var(--muted);
        --accent-primary: var(--primary);
        --accent-secondary: var(--accent-foreground);
        --accent-tertiary: var(--chart-2);
        --text-primary: var(--foreground);
        --text-secondary: var(--muted-foreground);
        --text-muted: var(--muted-foreground);
        --border-color: var(--border);
        --border-subtle: var(--border);
        --success-color: var(--chart-3);
        --warning-color: var(--chart-4);
        --error-color: var(--destructive);
        --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent-foreground));
        --gradient-secondary: linear-gradient(135deg, var(--primary), var(--chart-2));
        --gradient-accent: linear-gradient(135deg, var(--accent-foreground), var(--chart-2));
        --gradient-success: linear-gradient(135deg, var(--chart-3), var(--chart-3));
        --gradient-bg: linear-gradient(135deg, var(--background), var(--sidebar));
        --shadow-glow: 0 0 20px rgba(169, 149, 201, 0.3);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: block;
    text-align: center;
    padding: 0;
    margin: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.blank { 
    height: 300px;
}

/* Mobile-first approach adjustments */
@media (max-width: 768px) {
    .blank {
        height: 0;
    }
}

@media (max-width: 480px) {
    .blank {
        height: 0;
    }
}

/* Auto dark mode detection */
@media (prefers-color-scheme: dark) {
    :root {
        --background: rgb(26, 24, 35);
        --foreground: rgb(224, 221, 239);
        --card: rgb(35, 32, 48);
        --card-foreground: rgb(224, 221, 239);
        --popover: rgb(35, 32, 48);
        --popover-foreground: rgb(224, 221, 239);
        --primary: rgb(169, 149, 201);
        --primary-foreground: rgb(26, 24, 35);
        --secondary: rgb(90, 83, 112);
        --secondary-foreground: rgb(224, 221, 239);
        --muted: rgb(36, 32, 49);
        --muted-foreground: rgb(160, 154, 173);
        --accent: rgb(55, 46, 63);
        --accent-foreground: rgb(242, 184, 198);
        --destructive: rgb(229, 115, 115);
        --destructive-foreground: rgb(26, 24, 35);
        --border: rgb(48, 44, 64);
        --input: rgb(42, 39, 58);
        --ring: rgb(169, 149, 201);
        --chart-1: rgb(169, 149, 201);
        --chart-2: rgb(242, 184, 198);
        --chart-3: rgb(119, 184, 161);
        --chart-4: rgb(240, 200, 141);
        --chart-5: rgb(160, 187, 227);
        --sidebar: rgb(22, 20, 30);
        --sidebar-foreground: rgb(224, 221, 239);
        --sidebar-primary: rgb(169, 149, 201);
        --sidebar-primary-foreground: rgb(26, 24, 35);
        --sidebar-accent: rgb(55, 46, 63);
        --sidebar-accent-foreground: rgb(242, 184, 198);
        --sidebar-border: rgb(42, 39, 58);
        --sidebar-ring: rgb(169, 149, 201);
        
        /* Dark theme custom mappings */
        --bg-primary: var(--background);
        --bg-secondary: var(--card);
        --bg-tertiary: var(--muted);
        --bg-card: var(--card);
        --bg-hover: var(--accent);
        --bg-muted: var(--muted);
        --accent-primary: var(--primary);
        --accent-secondary: var(--accent-foreground);
        --accent-tertiary: var(--chart-2);
        --text-primary: var(--foreground);
        --text-secondary: var(--muted-foreground);
        --text-muted: var(--muted-foreground);
        --border-color: var(--border);
        --border-subtle: var(--border);
        --success-color: var(--chart-3);
        --warning-color: var(--chart-4);
        --error-color: var(--destructive);
        --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent-foreground));
        --gradient-secondary: linear-gradient(135deg, var(--primary), var(--chart-2));
        --gradient-accent: linear-gradient(135deg, var(--accent-foreground), var(--chart-2));
        --gradient-success: linear-gradient(135deg, var(--chart-3), var(--chart-3));
        --gradient-bg: linear-gradient(135deg, var(--background), var(--sidebar));
        --shadow-glow: 0 0 20px rgba(169, 149, 201, 0.3);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: block;
    text-align: center;
    padding: 0;
    margin: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.blank { 
    height: 300px;
}

/* Mobile-first approach adjustments */
@media (max-width: 768px) {
    .blank {
        height: 0;
    }
}

@media (max-width: 480px) {
    .blank {
        height: 0;
    }
}

/* Auto dark mode detection */
@media (prefers-color-scheme: dark) {
    :root {
        --background: rgb(26, 24, 35);
        --foreground: rgb(224, 221, 239);
        --card: rgb(35, 32, 48);
        --card-foreground: rgb(224, 221, 239);
        --popover: rgb(35, 32, 48);
        --popover-foreground: rgb(224, 221, 239);
        --primary: rgb(169, 149, 201);
        --primary-foreground: rgb(26, 24, 35);
        --secondary: rgb(90, 83, 112);
        --secondary-foreground: rgb(224, 221, 239);
        --muted: rgb(36, 32, 49);
        --muted-foreground: rgb(160, 154, 173);
        --accent: rgb(55, 46, 63);
        --accent-foreground: rgb(242, 184, 198);
        --destructive: rgb(229, 115, 115);
        --destructive-foreground: rgb(26, 24, 35);
        --border: rgb(48, 44, 64);
        --input: rgb(42, 39, 58);
        --ring: rgb(169, 149, 201);
        --chart-1: rgb(169, 149, 201);
        --chart-2: rgb(242, 184, 198);
        --chart-3: rgb(119, 184, 161);
        --chart-4: rgb(240, 200, 141);
        --chart-5: rgb(160, 187, 227);
        --sidebar: rgb(22, 20, 30);
        --sidebar-foreground: rgb(224, 221, 239);
        --sidebar-primary: rgb(169, 149, 201);
        --sidebar-primary-foreground: rgb(26, 24, 35);
        --sidebar-accent: rgb(55, 46, 63);
        --sidebar-accent-foreground: rgb(242, 184, 198);
        --sidebar-border: rgb(42, 39, 58);
        --sidebar-ring: rgb(169, 149, 201);
        
        /* Dark theme custom mappings */
        --bg-primary: var(--background);
        --bg-secondary: var(--card);
        --bg-tertiary: var(--muted);
        --bg-card: var(--card);
        --bg-hover: var(--accent);
        --bg-muted: var(--muted);
        --accent-primary: var(--primary);
        --accent-secondary: var(--accent-foreground);
        --accent-tertiary: var(--chart-2);
        --text-primary: var(--foreground);
        --text-secondary: var(--muted-foreground);
        --text-muted: var(--muted-foreground);
        --border-color: var(--border);
        --border-subtle: var(--border);
        --success-color: var(--chart-3);
        --warning-color: var(--chart-4);
        --error-color: var(--destructive);
        --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent-foreground));
        --gradient-secondary: linear-gradient(135deg, var(--primary), var(--chart-2));
        --gradient-accent: linear-gradient(135deg, var(--accent-foreground), var(--chart-2));
        --gradient-success: linear-gradient(135deg, var(--chart-3), var(--chart-3));
        --gradient-bg: linear-gradient(135deg, var(--background), var(--sidebar));
        --shadow-glow: 0 0 20px rgba(169, 149, 201, 0.3);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: block;
    text-align: center;
    padding: 0;
    margin: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.blank { 
    height: 300px;
}

/* Mobile-first approach adjustments */
@media (max-width: 768px) {
    .blank {
        height: 0;
    }
}

@media (max-width: 480px) {
    .blank {
        height: 0;
    }
}

/* Auto dark mode detection */
@media (prefers-color-scheme: dark) {
    :root {
        --background: rgb(26, 24, 35);
        --foreground: rgb(224, 221, 239);
        --card: rgb(35, 32, 48);
        --card-foreground: rgb(224, 221, 239);
        --popover: rgb(35, 32, 48);
        --popover-foreground: rgb(224, 221, 239);
        --primary: rgb(169, 149, 201);
        --primary-foreground: rgb(26, 24, 35);
        --secondary: rgb(90, 83, 112);
        --secondary-foreground: rgb(224, 221, 239);
        --muted: rgb(36, 32, 49);
        --muted-foreground: rgb(160, 154, 173);
        --accent: rgb(55, 46, 63);
        --accent-foreground: rgb(242, 184, 198);
        --destructive: rgb(229, 115, 115);
        --destructive-foreground: rgb(26, 24, 35);
        --border: rgb(48, 44, 64);
        --input: rgb(42, 39, 58);
        --ring: rgb(169, 149, 201);
        --chart-1: rgb(169, 149, 201);
        --chart-2: rgb(242, 184, 198);
        --chart-3: rgb(119, 184, 161);
        --chart-4: rgb(240, 200, 141);
        --chart-5: rgb(160, 187, 227);
        --sidebar: rgb(22, 20, 30);
        --sidebar-foreground: rgb(224, 221, 239);
        --sidebar-primary: rgb(169, 149, 201);
        --sidebar-primary-foreground: rgb(26, 24, 35);
        --sidebar-accent: rgb(55, 46, 63);
        --sidebar-accent-foreground: rgb(242, 184, 198);
        --sidebar-border: rgb(42, 39, 58);
        --sidebar-ring: rgb(169, 149, 201);
        
        /* Dark theme custom mappings */
        --bg-primary: var(--background);
        --bg-secondary: var(--card);
        --bg-tertiary: var(--muted);
        --bg-card: var(--card);
        --bg-hover: var(--accent);
        --bg-muted: var(--muted);
        --accent-primary: var(--primary);
        --accent-secondary: var(--accent-foreground);
        --accent-tertiary: var(--chart-2);
        --text-primary: var(--foreground);
        --text-secondary: var(--muted-foreground);
        --text-muted: var(--muted-foreground);
        --border-color: var(--border);
        --border-subtle: var(--border);
        --success-color: var(--chart-3);
        --warning-color: var(--chart-4);
        --error-color: var(--destructive);
        --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent-foreground));
        --gradient-secondary: linear-gradient(135deg, var(--primary), var(--chart-2));
        --gradient-accent: linear-gradient(135deg, var(--accent-foreground), var(--chart-2));
        --gradient-success: linear-gradient(135deg, var(--chart-3), var(--chart-3));
        --gradient-bg: linear-gradient(135deg, var(--background), var(--sidebar));
        --shadow-glow: 0 0 20px rgba(169, 149, 201, 0.3);
    }
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: var(--bg-primary);
    opacity: 0.9;
}

.particle {
    position: absolute;
    background: var(--gradient-secondary);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.4;
    animation: float 6s ease-in-out infinite;
    filter: blur(1px);
    will-change: transform;
}

.particle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    left: 80%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    width: 40px;
    height: 40px;
    top: 10%;
    left: 70%;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    width: 100px;
    height: 100px;
    top: 40%;
    left: 50%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(20px) rotate(240deg); }
}

/* Container */
.container {
    max-width: 900px;
    width: 100%;
    height: 100vh; /* Full viewport height */
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem; /* Reduced gap for better fit */
    box-sizing: border-box;
    overflow: hidden; /* Prevent scrolling */
    position: relative;
    flex: 1; /* Take available space */
}

/* Mobile-first container adjustments */
@media (max-width: 768px) {
    html {
        overflow: auto; /* Allow scrolling on mobile */
    }
    
    body {
        overflow: auto; /* Allow scrolling on mobile */
        height: auto; /* Auto height on mobile */
        min-height: 100vh; /* Minimum height on mobile */
    }
    
    .container {
        max-width: 100%;
        width: 100%;
        height: auto; /* Auto height on mobile */
        min-height: 100vh; /* Minimum height on mobile */
        margin: 0;
        padding: 0;
        gap: 0;
        overflow: visible; /* Allow content to show on mobile */
        margin-bottom: 50px; /* Space for footer on mobile */
    }
    
    .blank {
        height: 0; /* Keep blank space removed on mobile too */
    }
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 0;
    animation: slideDown 0.8s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 3rem;
    color: var(--accent-primary);
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main Card */
.main-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    animation: slideUp 0.8s ease-out 0.2s both;
    backdrop-filter: blur(10px);
}

/* Input Section */
.input-section {
    padding: 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input);
    border-radius: var(--border-radius);
    border: 2px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--ring);
    box-shadow: var(--shadow-glow);
}

.input-icon {
    padding: 1rem;
    color: var(--text-muted);
    background: var(--muted);
    border-right: 1px solid var(--border);
}

#urlInput {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px; /* Prevents zoom on iOS */
    outline: none;
    font-family: inherit;
}

#urlInput::placeholder {
    color: var(--text-muted);
}

.fetch-btn {
    padding: 1rem 1.5rem;
    background: var(--gradient-secondary);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-glow);
}

.fetch-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium), var(--shadow-glow);
    background: linear-gradient(135deg, #9333ea 0%, #c084fc 100%);
}

.fetch-btn:active {
    transform: translateY(0);
}

/* --- Improved Mobile Input Group & URL Box --- */
@media (max-width: 768px) {
  .input-section {
    padding: 0.75rem 0.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
  }
  .input-group {
    flex-direction: column;
    border-radius: var(--border-radius);
    border-width: 2px;
    box-shadow: var(--shadow-glow);
    background: var(--input);
    padding: 0.5rem;
    gap: 0.5rem;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }
  .input-icon {
    padding: 0.5rem 0.75rem;
    font-size: 1.2rem;
    background: var(--muted);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  #urlInput {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
  #urlInput::placeholder {
    color: var(--text-muted);
    font-size: 1rem;
    opacity: 0.8;
    text-align: center;
  }
  .fetch-btn {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-top: 0.5rem;
    box-shadow: var(--shadow-glow);
  }
}
@media (max-width: 480px) {
  .input-section {
    padding: 0.5rem 0.25rem;
  }
  .input-group {
    max-width: 98vw;
    padding: 0.25rem;
    gap: 0.25rem;
  }
  #urlInput {
    padding: 0.5rem 0.5rem;
    font-size: 0.95rem;
  }
  .fetch-btn {
    font-size: 0.95rem;
    padding: 0.5rem 0;
  }
}
/* --- End Improved Mobile Input Group --- */

/* Loading Animation */
.loading {
    padding: 3rem 2rem;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 0.3rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

.loading-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Error Message */
.error-message {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--border-radius);
    margin: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--error-color);
    animation: shake 0.5s ease-in-out;
}

.error-message i {
    font-size: 1.2rem;
}

/* Video Info */
.video-info {
    padding: 2rem;
    animation: slideUp 0.5s ease-out;
}

.video-preview {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.thumbnail-container {
    position: relative;
    min-width: 200px;
    height: 120px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.thumbnail-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.thumbnail-container:hover .thumbnail-overlay {
    opacity: 1;
}

.thumbnail-overlay i {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.video-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#videoTitle {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.video-meta i {
    color: var(--accent-secondary);
}

/* Download Options */
.download-options {
    animation: slideUp 0.5s ease-out 0.1s both;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.quality-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gradient-success);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
}

.quality-indicator i {
    color: #ffd700;
}

/* Option Tabs */
.option-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 0.3rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: calc(var(--border-radius) - 3px);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    font-family: inherit;
}

.tab-button.active {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-small), var(--shadow-glow);
}

.tab-button:not(.active):hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.quality-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.quality-section h4 i {
    color: var(--accent-tertiary);
}

/* Quality Grid */
.quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.quality-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-subtle);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    font-family: inherit;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.quality-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(138, 121, 171, 0.1), transparent);
    transition: var(--transition);
}

.quality-card:hover::before {
    left: 100%;
}

.quality-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium), var(--shadow-glow);
}

.quality-card.premium {
    border-color: var(--accent-secondary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(230, 165, 184, 0.1) 100%);
}

.quality-card.premium:hover {
    border-color: var(--accent-primary);
}

.quality-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.quality-card.premium .quality-icon {
    background: var(--gradient-success);
}

.quality-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.quality-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.quality-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.quality-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.quality-badge.premium {
    background: var(--gradient-success);
    color: #ffd700;
}

/* Download Progress */
.download-progress {
    padding: 2rem;
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

.progress-container {
    max-width: 400px;
    margin: 0 auto;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.progress-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    animation: pulse 2s ease-in-out infinite;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-secondary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Download Complete */
.download-complete {
    padding: 3rem 2rem;
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

.success-animation {
    margin-bottom: 1.5rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.download-complete h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--success-color);
}

.success-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.download-btn {
    background: var(--gradient-success);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-small);
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Footer Styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    z-index: 1000;
    font-size: 14px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-text {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted-foreground);
    font-weight: 400;
}

.copyright {
    color: var(--foreground);
    font-weight: 500;
}

.divider {
    color: var(--border);
    font-weight: 300;
}

.github-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.github-link:hover {
    color: var(--accent);
    background: rgba(138, 121, 171, 0.1);
    transform: translateY(-1px);
}

.github-link i {
    font-size: 16px;
}

/* Adjust main container to account for footer */
.container {
    padding-bottom: 60px; /* Add space for footer on desktop */
}

/* Dynamic scaling for different screen resolutions */
@media (min-width: 1920px) {
    .container {
        max-width: 1200px; /* Larger container for 1080p+ screens */
        gap: 1.5rem;
    }
    
    .header {
        padding: 2.5rem 0;
    }
}

@media (min-width: 2560px) {
    .container {
        max-width: 1400px; /* Even larger for 1440p+ screens */
        gap: 2rem;
    }
    
    .header {
        padding: 3rem 0;
    }
}

@media (min-width: 3840px) {
    .container {
        max-width: 1600px; /* Maximum for 4K screens */
        gap: 2.5rem;
    }
    
    .header {
        padding: 4rem 0;
    }
}

/* Mobile Footer Styles */
@media (max-width: 768px) {
    .footer {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .footer-text {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    .github-link {
        gap: 4px;
        padding: 2px 6px;
    }
    
    .github-link i {
        font-size: 14px;
    }
    
    .container {
        margin-bottom: 0; /* Remove margin, use padding instead */
        padding-bottom: 50px; /* Smaller space on mobile */
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .footer-text {
        gap: 6px;
    }
    
    .github-link span {
        display: none; /* Hide "Github" text on very small screens, keep only icon */
    }
    
    .container {
        margin-bottom: 0; /* Remove margin, use padding instead */
        padding-bottom: 45px;
    }
}

/* Dark mode footer */
@media (prefers-color-scheme: dark) {
    .footer {
        background: rgba(30, 30, 30, 0.95);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .copyright {
        color: #e5e5e5;
    }
    
    .divider {
        color: rgba(255, 255, 255, 0.3);
    }
    
    .github-link {
        color: #8a79ab;
    }
    
    .github-link:hover {
        color: #e6a5b8;
        background: rgba(138, 121, 171, 0.15);
    }
}

/* PC-specific no-scroll layout optimizations */
@media (min-width: 769px) {
    /* Force fixed zoom level */
    html, body {
        zoom: 1 !important;
        -webkit-transform: scale(1) !important;
        -moz-transform: scale(1) !important;
        transform: scale(1) !important;
        -webkit-text-size-adjust: 100% !important;
        -moz-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
    }
    
    /* Ensure all main sections fit within viewport */
    .main-card {
        max-height: calc(100vh - 200px); /* Reserve space for header and footer */
        overflow-y: auto; /* Allow internal scrolling if needed */
        overflow-x: hidden;
    }
    
    /* Optimize video info display for no-scroll layout */
    #videoInfo {
        max-height: calc(100vh - 300px);
        overflow-y: auto;
    }
    
    /* Optimize quality selection for no-scroll layout */
    #videoQualities, #audioQualities {
        max-height: 300px;
        overflow-y: auto;
        scrollbar-width: thin;
    }
    
    /* Ensure header is appropriately sized */
    .header {
        padding: 1.5rem 0; /* Reduced padding for no-scroll layout */
        flex-shrink: 0; /* Don't shrink header */
    }
    
    /* Comprehensive zoom and touch prevention for PC */
    * {
        touch-action: manipulation !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -khtml-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
    
    /* Allow text selection for inputs */
    input, textarea, [contenteditable] {
        -webkit-user-select: text !important;
        -khtml-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes shimmer {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(400px); }
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        display: block;
        padding: 0;
        margin: 0;
        font-size: 14px;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
        width: 100%;
        margin: 0;
        min-height: 100vh;
        gap: 0;
    }
    
    .blank {
        height: 1rem;
    }
    
    .header {
        padding: 1.5rem 1rem 1rem;
        background: var(--bg-primary);
    }
    
    .logo {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 0.9rem;
        padding: 0 1rem;
        line-height: 1.4;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .main-card {
        border-radius: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }
    
    .input-section {
        padding: 1rem;
    }
    
    .input-group {
        flex-direction: column;
        border-radius: var(--border-radius);
    }
    
    .input-icon {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem 1rem;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    
    #urlInput {
        padding: 0.875rem 1rem;
        font-size: 16px;
        border-radius: 0;
    }
    
    .fetch-btn {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .video-preview {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .thumbnail-container {
        min-width: auto;
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
        height: 140px;
    }
    
    .video-details {
        text-align: center;
        padding: 0;
    }
    
    #videoTitle {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .video-meta {
        justify-content: center;
        font-size: 0.85rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .video-info {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .section-header h3 {
        font-size: 1.2rem;
    }
    
    .quality-indicator {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .option-tabs {
        flex-direction: row;
        margin-bottom: 1.25rem;
        padding: 0.25rem;
    }
    
    .tab-button {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        gap: 0.25rem;
    }
    
    .tab-button i {
        font-size: 0.9rem;
    }
    
    .quality-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .quality-card {
        padding: 1rem;
        gap: 0.75rem;
        border-radius: var(--border-radius);
    }
    
    .quality-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .quality-info {
        flex: 1;
        min-width: 0;
    }
    
    .quality-title {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
    }
    
    .quality-details {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .quality-badge {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    .download-options {
        margin-top: 0;
    }
    
    .download-progress {
        padding: 1rem;
    }
    
    .progress-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .download-complete {
        padding: 1.5rem 1rem;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .download-complete h3 {
        font-size: 1.4rem;
    }
    
    .download-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        width: auto;
        min-width: 160px;
        max-width: 280px;
    }
    
    .loading {
        padding: 2rem 1rem;
    }
    
    .spinner {
        width: 45px;
        height: 45px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .error-message {
        margin: 1rem;
        padding: 1rem;
        font-size: 0.9rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .error-message i {
        font-size: 1.5rem;
    }
}

/* Ensure mobile layout stability */
@media (max-width: 768px) {
    /* Fix background animation performance on mobile */
    .background-animation {
        will-change: auto;
        transform: translateZ(0);
    }
    
    /* Ensure no horizontal overflow */
    .container, .main-card, .input-section, .video-info {
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Optimize for mobile browsers */
    * {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
    }
    
    /* Better mobile scrolling */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
}

/* Extra small devices (portrait phones) */
@media (max-width: 480px) {
    .header {
        padding: 1rem 0.75rem 0.75rem;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .logo i {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 0.85rem;
        max-width: 260px;
    }
    
    .input-section {
        padding: 0.75rem;
    }
    
    .quality-card {
        padding: 0.875rem;
        gap: 0.625rem;
    }
    
    .quality-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .quality-title {
        font-size: 0.9rem;
    }
    
    .quality-details {
        font-size: 0.75rem;
    }
    
    .tab-button {
        padding: 0.625rem 0.375rem;
        font-size: 0.8rem;
    }
    
    .section-header h3 {
        font-size: 1.1rem;
    }
    
    .quality-indicator {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }
    
    .main-card {
        border: none;
        box-shadow: none;
    }
    
    /* Optimize background particles for mobile */
    .particle {
        opacity: 0.2;
        filter: blur(2px);
    }
    
    .particle:nth-child(n+4) {
        display: none; /* Hide extra particles on mobile */
    }
}

/* Extra small devices (landscape phones) */
@media (max-width: 576px) and (orientation: landscape) {
    .container {
        padding: 0.5rem;
        min-height: 100vh;
    }
    
    .header {
        padding: 0.5rem 0;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .logo i {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    .blank {
        height: 0;
    }
    
    .video-preview {
        flex-direction: row;
        text-align: left;
    }
    
    .thumbnail-container {
        max-width: 120px;
        height: 80px;
    }
    
    .video-details {
        text-align: left;
    }
    
    .video-meta {
        justify-content: flex-start;
    }
}

/* High DPI displays (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .quality-icon, .success-icon {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Focus Styles */
button:focus,
input:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}
