/* --- ./variables.css --- */
/* ======================================================
   Design Tokens & Core
   ====================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Colors - Duck Streams Signature */
    --bg-color: #1c1917;
    /* Deep Warm Stone */
    --card-bg: rgba(41, 37, 36, 0.65);
    /* Translucent Stone Glass */
    --text-primary: #fafaf9;
    /* Warm Off-White */
    --text-secondary: #a8a29e;
    /* Warm Gray */

    /* Brand - Golden Duck */
    --accent: #ffd166;
    /* Golden Yellow */
    --accent-hover: #f4a261;
    /* Warm Orange */
    --accent-subtle: rgba(255, 209, 102, 0.15);

    /* Semantic */
    --success: #10b981;
    /* Emerald */
    --error: #ef4444;
    /* Red */
    --input-bg: rgba(28, 25, 23, 0.9);
    /* Solid Dark Stone */
    --border-color: rgba(255, 209, 102, 0.15);
    /* Tinted Gold border */

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(255, 255, 255, 0.2);

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing (Strict 4px Scale) */
    --space-xs: 0.25rem;
    /* 4px */
    --space-sm: 0.5rem;
    /* 8px */
    --space-md: 1rem;
    /* 16px */
    --space-lg: 1.5rem;
    /* 24px */
    --space-xl: 2.5rem;
    /* 40px */
    --space-2xl: 4rem;
    /* 64px */

    /* Radius (Softer & Rounder) */
    --radius-sm: 0.375rem;
    /* 6px */
    --radius-md: 0.75rem;
    /* 12px */
    --radius-lg: 1rem;
    /* 16px */
    --radius-xl: 1.5rem;
    /* 24px */

    /* Shadows (Depth) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 15px rgba(255, 209, 102, 0.3);

    /* Motion */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


/* --- ./base.css --- */
/* ======================================================
   Base & Typography
   ====================================================== */
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(255, 209, 102, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 85% 30%, rgba(244, 162, 97, 0.03) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 {
    margin: 0 0 var(--space-xs);
    font-size: 2.75rem;
    /* Slightly restrained */
    font-weight: 800;
    text-align: center;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    /* Tight & Modern */
    line-height: 1.1;
}

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

::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}


/* --- ./layout.css --- */
/* ======================================================
   Layout & Containers
   ====================================================== */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-xl);
    text-align: center;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
    box-sizing: border-box;
}

.header-section {
    text-align: center;
    margin-bottom: var(--space-2xl);
    animation: fadeInDown 0.6s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

/* Centered Body Layout (Landing/Auth) */
body.centered {
    justify-content: flex-start;
    align-items: center;
    padding: var(--space-md);
    padding-top: var(--space-2xl);
    /* More breathing room */
    box-sizing: border-box;
}

@media (min-width: 769px) {
    body.centered {
        padding-left: calc(var(--sidebar-width, 0px) + var(--space-xl));
    }
}

@media (max-width: 768px) {
    body.centered {
        padding-top: var(--space-xl);
    }
}

/* Advanced View Layout (Full Page Apps) */
.view-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}

.view-section.hidden {
    display: none !important;
}

.mobile-full-height {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 0;
}

.view-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    position: sticky;
    top: 0;
    background: transparent;
    z-index: 10;
    padding: var(--space-sm) 0;
    backdrop-filter: blur(8px);
}

.view-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.advanced-scroll-content {
    flex: 1;
    padding-bottom: 0;
}


/* --- ./components/buttons.css --- */
/* ======================================================
   Component: Buttons
   ====================================================== */
button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #1a1025;
    background: var(--accent);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    box-shadow: 0 10px 20px -3px rgba(255, 209, 102, 0.5);
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--text-secondary);
    box-shadow: none;
}

/* Button Variants */
button.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

button.danger:hover:not(:disabled) {
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-2px);
    box-shadow: none;
}

.btn-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Auth Action Links */
.auth-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-sm);
}

.auth-actions button {
    width: auto;
    padding: 0;
    font-size: 0.85rem;
    background: none;
    color: var(--accent);
    text-decoration: underline;
    opacity: 0.9;
    box-shadow: none;
    border: none;
}

.auth-actions button:hover {
    opacity: 1;
    color: var(--accent-hover);
    background: none;
    transform: none;
    box-shadow: none;
}

/* Floating Form Corner Button */
.form-corner-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-base);
    z-index: 10;
}

.form-corner-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.05);
}


/* --- ./components/forms.css --- */
/* ======================================================
   Component: Forms
   ====================================================== */
.field {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

input,
select {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    transition: all 0.2s;
}

input:focus,
select:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.15);
}

input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Input with Icon Wrapper */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.input-icon-right {
    position: absolute;
    right: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 1;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.input-icon-right:hover {
    color: var(--text-primary);
}

.input-with-icon input {
    padding-left: 3rem;
}

.input-with-icon-right input {
    padding-right: 3rem;
}

.input-right-icon-only {
    position: relative;
    display: flex;
    align-items: center;
}

.input-right-icon-only input {
    padding-right: 3rem;
}



/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    justify-content: center;
    margin-top: var(--space-lg);
}

.checkbox-label {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color var(--transition-base);
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 6px;
    background-color: var(--input-bg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0;
    /* Reset padding for checkbox */
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(41, 37, 36, 0.8);
    border-radius: 26px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #10b981;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-slider:hover:not(:has(input:disabled)) {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.toggle-switch.loading .toggle-slider {
    opacity: 0.6;
    cursor: wait;
}

.toggle-switch.loading .toggle-slider:before {
    animation: pulse 1.5s ease-in-out infinite;
}


/* --- ./components/cards.css --- */
/* ======================================================
   Component: Cards & Containers
   ====================================================== */
.section-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: left;
    margin-bottom: 2rem;
}

.section-card h3 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 700;
}

.auth-section {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.auth-section .tabs {
    margin-bottom: var(--space-lg);
    background: rgba(0, 0, 0, 0.2);
    border: none;
}

.auth-section .field:last-child {
    margin-bottom: 0;
}

.info-box {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: var(--space-xl);
    background: var(--accent-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: left;
}

.info-box svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--accent);
    flex-shrink: 0;
    opacity: 0.9;
}

.info-box p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-box b {
    color: #fff;
}

.result-box {
    display: none;
    margin-top: var(--space-xl);
    padding: var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    position: relative;
    text-align: left;
}

.result-box.error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

.result-title {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: bold;
}

.api-key {
    position: relative;
    padding: var(--space-md) 3.5rem var(--space-md) var(--space-md);
    font-family: var(--font-mono);
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    word-break: break-all;
    user-select: all;
    color: var(--text-primary);
}


/* --- ./components/modals.css --- */
/* ======================================================
   Component: Modals
   ====================================================== */
/* Simple Modal (Unified) */
.simple-modal-overlay,
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay {
    background-color: rgba(28, 25, 23, 0.8);
    backdrop-filter: blur(8px);
    display: none;
}

.modal-overlay:not(.hidden) {
    display: flex;
}

@media (min-width: 769px) {
    .modal-overlay {
        left: var(--sidebar-width, 0px);
    }
}

/* Base Modal Style */
.simple-modal,
.modal {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    transform: scale(0.95);
    animation: zoomInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    color: #fff;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    text-align: left;
}

.modal {
    /* Legacy Modal Overrides */
    max-width: 450px;
    padding: var(--space-xl);
    background-color: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.simple-modal.fade-out {
    animation: fadeOut 0.2s ease-in forwards;
}

.simple-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.simple-modal-header .icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.simple-modal-header .icon-wrapper svg {
    width: 1.5rem;
    height: 1.5rem;
}

.simple-modal-header-content h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.simple-modal-body {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.simple-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
}

.simple-modal-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.simple-modal-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: var(--shadow-glow);
}

.simple-modal-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    border: none;
}

.simple-modal-btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #1c1917;
    font-weight: 700;
}

.simple-modal-btn.primary:hover {
    box-shadow: var(--shadow-glow);
    opacity: 0.9;
}

.simple-modal-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.simple-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Legacy Modal Credential Display */
.credential-group {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.result-box .credential-group {
    margin-bottom: 0;
}

.credential-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
}

.credential-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.credential-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.credential-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.credential-value {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-icon-btn:hover {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--accent);
}

.copy-icon-btn.copied {
    color: var(--success);
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.copy-icon-btn svg {
    width: 18px;
    height: 18px;
}

.setup-hint {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.modal-steps {
    text-align: left;
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: var(--input-bg);
    border-radius: var(--radius-lg);
}

.modal-steps h3 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.modal-steps ol {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-steps li {
    margin-bottom: 0.5rem;
}


/* --- ./components/component:-tabs.css --- */
/* ======================================================
   Component: Tabs
   ====================================================== */
.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-xs);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    position: relative;
    gap: var(--space-xs);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    box-shadow: none;
}

.tab-btn:hover:not(.active) {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #1a1025;
    font-weight: 700;
    opacity: 1;
    background: var(--accent);
    box-shadow: var(--shadow-glow);
}


/* --- ./components/component:-validation-&-loading.css --- */
/* ======================================================
   Component: Validation & Loading
   ====================================================== */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: var(--space-sm);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

.loading-duck {
    position: relative;
    display: inline-block;
    margin-right: var(--space-sm);
    animation: duck-bob 1.5s ease-in-out infinite;
    font-size: 1.25rem;
    vertical-align: middle;
    z-index: 2;
}

/* Front Wave */
.loading-duck::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: -4px;
    right: -4px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpath d='M0 5 Q 5 0 10 5 T 20 5 V 10 H 0 Z' fill='%23ffd166'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 20px 10px;
    animation: wave-slide 1.5s linear infinite;
    opacity: 0.7;
    z-index: 3;
    /* Slightly in front of duck */
}

/* Back Wave */
.loading-duck::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: -4px;
    right: -4px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpath d='M0 5 Q 5 0 10 5 T 20 5 V 10 H 0 Z' fill='%23ffd166'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 20px 10px;
    animation: wave-slide 2.5s linear infinite reverse;
    opacity: 0.3;
    z-index: 1;
    /* Behind duck */
}

.status-message {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: left;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-message.loading {
    color: var(--text-secondary);
    font-style: italic;
}

.control-row.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    animation: shake 0.4s ease-in-out;
}

.control-error-message {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
    animation: fadeIn 0.2s ease;
}


/* --- ./components/feature:-landing-page.css --- */
/* ======================================================
   Feature: Landing Page
   ====================================================== */
.mascot-wrapper {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.mascot-wrapper::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 209, 102, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(20px);
}

.mascot {
    position: relative;
    font-size: 4.5rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: duck-bob 1.5s ease-in-out infinite;
    display: inline-block;
    z-index: 2;
}

/* Hero Front Wave */
.mascot::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: -15px;
    right: -15px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpath d='M0 5 Q 5 0 10 5 T 20 5 V 10 H 0 Z' fill='%23ffd166'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 40px 20px;
    animation: wave-slide-hero 1.5s linear infinite;
    opacity: 0.7;
    z-index: 3;
}

/* Hero Back Wave */
.mascot::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: -15px;
    right: -15px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpath d='M0 5 Q 5 0 10 5 T 20 5 V 10 H 0 Z' fill='%23ffd166'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 40px 20px;
    animation: wave-slide-hero 2.5s linear infinite reverse;
    opacity: 0.3;
    z-index: 1;
}

.duck-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    position: relative;
    top: -2px;
}

.mascot .duck-icon {
    width: 4.5rem;
    height: 4.5rem;
}

.loading-duck .duck-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-bottom: 2px;
}

.tool-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-item {
    position: relative;
    background: rgba(28, 25, 23, 0.6);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.tool-item:hover {
    background: rgba(41, 37, 36, 0.8);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.tool-card-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    height: auto;
}

.tool-content-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.tool-icon-wrapper {
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tool-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: 0.01em;
}

.arrow-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: transform 0.2s ease, color 0.2s ease;
}

.tool-item:hover .arrow-icon {
    transform: translateX(4px);
    color: #fff;
    opacity: 1;
}

.signup,
.helper,
.trust {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: var(--space-sm);
    text-align: left;
}

.signup a,
.helper a,
.trust a {
    color: var(--accent);
    text-decoration: none;
}

.signup a:hover,
.helper a:hover,
.trust a:hover {
    text-decoration: underline;
}

.trust {
    margin-top: var(--space-lg);
}


/* --- ./components/feature-quackstart.css --- */
/* ======================================================
   Feature: QuackStart
   ====================================================== */
.link-clean {
    color: var(--accent);
    text-decoration: none;
}

.debridio-icon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.divider-pipe {
    margin: 0 6px;
    opacity: 0.3;
}

.preview-container {
    margin-top: 1rem;
    border-radius: 0.25rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.img-fluid {
    width: 100%;
    height: auto;
    display: block;
}

/* Advanced Configuration (Details/Summary) */
details {
    margin: var(--space-xl) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

summary {
    padding: var(--space-md) 0;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

summary:hover {
    color: var(--text-primary);
}

summary::before {
    content: '›';
    font-size: 1.2rem;
    transition: transform var(--transition-base);
}

details[open] summary::before {
    transform: rotate(90deg);
}

.advanced-content {
    padding-bottom: var(--space-md);
    animation: slideDown var(--transition-base);
}

.settings-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.group-header {
    margin-bottom: var(--space-md);
    text-align: left;
}

.group-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.group-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.size-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
}

.preset-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    box-shadow: none;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: none;
    box-shadow: none;
    border-color: var(--text-secondary);
}

.preset-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

/* Footer Options */
.advanced-footer {
    margin-top: 2rem;
    padding-bottom: 0;
    width: 100%;
}

@media (min-width: 769px) {
    .advanced-footer {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

.advanced-trigger-container {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.advanced-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
}

.advanced-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.footer-options {
    margin-top: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-options details {
    flex: 1;
    min-width: 200px;
    border: none !important;
    margin: 0 !important;
    background: transparent !important;
    padding: 0;
}

.footer-options summary {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.footer-options summary:hover {
    color: var(--text-primary);
}

.footer-options .field {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.settings-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.step-label {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    text-align: left;
    padding-left: 2px;
}


/* --- ./components/feature:-cinepatch.css --- */
/* ======================================================
   Feature: CinePatch
   ====================================================== */
.patch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.patch-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.patch-details {
    display: flex;
    flex-direction: column;
}

/* Provider/Patch Card (Checkboxes) */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.provider-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 44px;
    margin-bottom: 0;
}

.provider-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.provider-card:has(input:checked) {
    background: var(--accent-subtle);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.provider-card:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.card-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.provider-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.provider-name {
    font-weight: 600;
    color: var(--text-primary);
}

.provider-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.card-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: transparent;
    transition: all 0.2s;
}

.provider-card:has(input:checked) .card-indicator {
    background: var(--accent);
    color: white;
}

.card-indicator svg {
    width: 14px;
    height: 14px;
}

.login-row {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .login-row {
        grid-template-columns: 1fr 1fr;
    }
}

.divider-text {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 1rem 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider-text::before {
    margin-right: .5em;
}

.divider-text::after {
    margin-left: .5em;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* --- ./components/addon-locker.css --- */
/* ======================================================
   Feature: Addon Locker
   ====================================================== */
.addon-locker-header {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.user-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg-hover);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 auto 2rem auto;
    max-width: fit-content;
}

.user-status-pill b {
    color: var(--text-primary);
}

.logout-link {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.logout-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.addon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: start;
}

.addon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.addon-item:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border);
}

.addon-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.addon-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.addon-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-radius: 0.75rem;
}

.addon-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.addon-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.addon-control-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.addon-control-pair {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.control-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1;
}

.addon-control-label-text {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
}

.addon-control-status {
    font-weight: 700;
    font-size: 0.7rem;
    margin-left: 0;
    margin-bottom: 0;
    text-transform: uppercase;
}

.addon-control-status.allowed {
    color: #86efac;
}

.addon-control-status.blocked {
    color: #fca5a5;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .addon-list {
        grid-template-columns: 1fr;
    }

    .addon-item {
        flex-direction: row;
        text-align: left;
        padding: 1rem;
        gap: 1rem;
        min-height: auto;
    }

    .addon-icon,
    .addon-icon-fallback {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }

    .addon-name {
        font-size: 1rem;
        margin-bottom: 0;
        flex: 1;
    }

    .addon-controls {
        width: auto;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex-direction: row;
    }

    .addon-control-status {
        display: block;
        font-size: 0.6rem;
    }
}


/* --- ./components/feature:-account-cloner.css --- */
/* ======================================================
   Feature: Account Cloner
   ====================================================== */
.responsive-columns {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    align-items: center;
}

.transfer-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
    transition: transform 0.3s ease;
}

.transfer-indicator svg {
    width: 1.5rem;
    height: 1.5rem;
}

@media (max-width: 768px) {
    .responsive-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }

    .responsive-columns>*:last-child {
        margin-bottom: 1rem;
    }

    .transfer-indicator {
        margin: 0 auto;
        transform: rotate(90deg);
    }
}


/* --- ./components/utilities-&-animations.css --- */
/* ======================================================
   Utilities & Animations
   ====================================================== */
.hidden {
    display: none !important;
}

.text-muted {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.text-center {
    text-align: center;
}

.text-success {
    color: var(--success) !important;
}

.text-error {
    color: var(--error) !important;
}

.w-100 {
    width: 100%;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.my-1 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.pb-3 {
    padding-bottom: 1.5rem;
}

.d-block {
    display: block;
}

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

.flex-col-gap-xs {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.text-caption {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.beta-tag {
    display: inline-block;
    font-size: 0.3em;
    vertical-align: middle;
    margin-left: 0.5rem;
    padding: 0.25em 0.6em;
    -webkit-text-fill-color: var(--accent);
    background: rgba(255, 209, 102, 0.15);
    color: var(--accent);
    border: 1px solid rgba(255, 209, 102, 0.3);
    border-radius: var(--radius-md);
    font-weight: 700;
    letter-spacing: 0.05em;
    transform: translateY(-0.15em);
    line-height: normal;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomInModal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes duck-bob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* FAB Icon States */

@keyframes wave-slide {
    from {
        background-position-x: 0;
    }

    to {
        background-position-x: -20px;
    }
}

@keyframes wave-slide-hero {
    from {
        background-position-x: 0;
    }

    to {
        background-position-x: -40px;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Mobile Global Adjustments (Final Overrides) */
@media (max-width: 480px) {
    h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .container {
        padding: 1.25rem;
    }

    label {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    .result-box,
    .section-card {
        padding: 1rem;
    }

    #cloneBtn {
        margin-bottom: 4rem;
        width: 100%;
        max-width: 100%;
    }

    .tool-list {
        width: 100%;
    }

    .tab-btn {
        font-size: 0.85rem;
        padding: 0.6rem;
    }
}

@media (max-width: 640px) {
    body.centered {
        padding-top: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .container {
        padding: 1.25rem;
    }

    h1 {
        font-size: 2rem;
    }

    .section-card {
        padding: 1rem;
    }

    .auth-section {
        padding: 1rem;
    }

    .tab-btn {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
}


/* --- ./components/addon-locker.css --- */
/* ======================================================
   Feature: Addon Locker
   ====================================================== */
.addon-locker-header {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.user-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg-hover);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 auto 2rem auto;
    max-width: fit-content;
}

.user-status-pill b {
    color: var(--text-primary);
}

.logout-link {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.logout-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.addon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: start;
}

.addon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.addon-item:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border);
}

.addon-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.addon-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.addon-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-radius: 0.75rem;
}

.addon-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.addon-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.addon-control-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.addon-control-pair {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.control-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1;
}

.addon-control-label-text {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
}

.addon-control-status {
    font-weight: 700;
    font-size: 0.7rem;
    margin-left: 0;
    margin-bottom: 0;
    text-transform: uppercase;
}

.addon-control-status.allowed {
    color: #86efac;
}

.addon-control-status.blocked {
    color: #fca5a5;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .addon-list {
        grid-template-columns: 1fr;
    }

    .addon-item {
        flex-direction: row;
        text-align: left;
        padding: 1rem;
        gap: 1rem;
        min-height: auto;
    }

    .addon-icon,
    .addon-icon-fallback {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }

    .addon-name {
        font-size: 1rem;
        margin-bottom: 0;
        flex: 1;
    }

    .addon-controls {
        width: auto;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex-direction: row;
    }

    .addon-control-status {
        display: block;
        font-size: 0.6rem;
    }
}


/* --- ./components/addon-butler.css --- */
/* ======================================================
   Feature: Addon Butler
   ====================================================== */
/* Single-column list — optimised for drag-to-reorder */
.butler-addon-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    animation: fadeInUp 0.4s ease-out;
}

/* Row card */
.butler-addon-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.875rem;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.butler-addon-item:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
}

/* Being dragged */
.butler-addon-item.dragging {
    opacity: 0.45;
    border-color: rgba(255, 209, 102, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.25);
}

/* Valid drop target */
.butler-addon-item.drag-over {
    background: rgba(255, 209, 102, 0.08);
    border-color: rgba(255, 209, 102, 0.45);
    box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.2);
}

/* Grip handle */
.butler-drag-handle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: rgba(148, 163, 184, 0.4);
    cursor: grab;
    transition: color 0.15s ease;
    padding: 0 2px;
}

.butler-drag-handle:active {
    cursor: grabbing;
}

.butler-addon-item:hover .butler-drag-handle {
    color: rgba(148, 163, 184, 0.8);
}

.butler-drag-handle svg {
    width: 16px;
    height: 16px;
}

/* Icon */
.butler-addon-icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.butler-addon-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.butler-addon-icon .addon-icon-fallback {
    font-size: 1.4rem;
    background: transparent;
    border-radius: 0;
    color: #22c55e;
}

/* Name */
.butler-addon-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Controls section — reuse existing toggle styles, just shrink gaps */
.butler-addon-item .addon-controls {
    flex-shrink: 0;
    gap: 0.75rem !important;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    width: auto !important;
}

.butler-addon-item .addon-control-pair {
    gap: 0.2rem;
    font-size: 0.8rem;
}

.butler-addon-item .control-divider {
    height: 28px;
}

.butler-mobile-reorder {
    display: none;
}

/* Mobile adjustments for Addon Butler */
@media (max-width: 640px) {
    .butler-addon-item {
        display: grid;
        grid-template-columns: auto auto 1fr;
        grid-template-rows: auto auto;
        gap: 0.25rem 0.75rem;
        padding: 0.75rem;
        align-items: center;
    }

    .butler-drag-handle {
        display: none !important;
    }

    .butler-mobile-reorder {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        grid-column: 1;
        grid-row: 1 / span 2;
        align-items: center;
        justify-content: center;
    }

    .reorder-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--text-secondary);
        border-radius: 0.25rem;
        width: 1.5rem;
        height: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .reorder-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .reorder-btn:active {
        transform: scale(0.95);
    }

    .butler-addon-icon {
        grid-column: 2;
        grid-row: 1 / span 2;
        width: 2.25rem;
        height: 2.25rem;
    }

    .butler-addon-icon .addon-icon-fallback {
        font-size: 1.1rem;
    }

    .butler-addon-name {
        grid-column: 3;
        grid-row: 1;
        font-size: 0.875rem;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        align-self: end;
    }

    .butler-addon-item .addon-controls {
        grid-column: 3;
        grid-row: 2;
        display: flex;
        justify-content: flex-start;
        gap: 0.75rem !important;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        width: auto !important;
        align-self: start;
    }

    .butler-addon-item .addon-control-pair {
        font-size: 0.75rem;
        gap: 0.1rem;
    }

    .butler-addon-item .addon-control-label-text {
        font-size: 0.6rem;
    }

    .butler-addon-item .addon-control-status {
        font-size: 0.6rem;
    }

    .butler-container {
        margin-bottom: 5rem !important;
    }

    #loginBtn {
        max-width: calc(100% - 3.5rem) !important;
    }
}


/* --- ./components/recent-updates.css --- */
/* ======================================================
   Feature: Recent Updates
   ====================================================== */
.recent-updates-wrapper {
    margin-top: var(--space-2xl);
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.updates-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
    text-align: left;
    padding-left: var(--space-sm);
}

.updates-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.update-card {
    background: rgba(28, 25, 23, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.update-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border);
}

.update-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.update-version {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.update-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.update-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.update-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.update-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    margin-top: 1px;
}

.badge-feat {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-fix {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-other {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.update-text {
    flex: 1;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: none;
    width: auto;
    margin: 0 auto;
}

.version-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.version-badge.has-updates {
    animation: badge-pulse 1.5s infinite;
    border-color: rgba(255, 209, 102, 0.8);
    background: rgba(255, 209, 102, 0.15);
    color: #fff;
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(255, 209, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 209, 102, 0);
    }
}

.update-scope {
    font-weight: 700;
    color: var(--text-primary);
}

.modal-update-card {
    margin-bottom: var(--space-md);
}

.updates-modal-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: var(--space-xs);
}


/* --- main.css remaining --- */
/* Main stylesheet importing all modules */
