/* =============================================
   AI Tools Hub v3.0 - Modern Dark Theme CSS
   Premium Design System
   ============================================= */

/* ---- CSS Variables / Design Tokens ---- */
:root {
    --bg-primary: #0f111a;
    --bg-secondary: #161b22;
    --bg-tertiary: #12151f;
    --bg-card: #161b22;
    --bg-input: #0f111a;

    --border-primary: #1e293b;
    --border-hover: #334155;
    --border-focus: #6366f1;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --indigo-900: rgba(99, 102, 241, 0.15);

    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-900: rgba(16, 185, 129, 0.15);

    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --rose-900: rgba(244, 63, 94, 0.15);

    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    --purple-900: rgba(168, 85, 247, 0.15);

    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;

    --yellow-400: #fbbf24;
    --yellow-500: #f59e0b;

    --red-400: #f87171;
    --red-500: #ef4444;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow-indigo: 0 0 30px rgba(99, 102, 241, 0.15);
    --shadow-glow-emerald: 0 0 30px rgba(16, 185, 129, 0.15);
    --shadow-glow-rose: 0 0 30px rgba(244, 63, 94, 0.15);

    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    position: relative;
}

a {
    color: var(--indigo-400);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--indigo-500);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #334155;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #475569;
}

/* ---- Layout Helpers ---- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px;
    overflow-y: auto;
}

.page-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    text-align: center;
}

.container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.container-sm {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}

.container-md {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

/* ---- Grid System ---- */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-12 {
    grid-template-columns: repeat(12, 1fr);
}

.col-span-4 {
    grid-column: span 4;
}

.col-span-8 {
    grid-column: span 8;
}

.col-span-6 {
    grid-column: span 6;
}

.col-span-12 {
    grid-column: span 12;
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-12 {
        grid-template-columns: 1fr;
    }

    .col-span-4,
    .col-span-8,
    .col-span-6 {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .page-wrapper {
        padding: 16px;
    }
}

/* ---- Flex Helpers ---- */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-6 {
    gap: 24px;
}

.flex-1 {
    flex: 1;
}

.shrink-0 {
    flex-shrink: 0;
}

/* ---- Spacing ---- */
.space-y-3>*+* {
    margin-top: 12px;
}

.space-y-4>*+* {
    margin-top: 16px;
}

.space-y-6>*+* {
    margin-top: 24px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-4 {
    margin-top: 16px;
}

.mt-6 {
    margin-top: 24px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.p-4 {
    padding: 16px;
}

.p-5 {
    padding: 20px;
}

.p-6 {
    padding: 24px;
}

/* ---- Typography ---- */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-5xl {
    font-size: 3rem;
    line-height: 1.1;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.tracking-tight {
    letter-spacing: -0.025em;
}

.text-center {
    text-align: center;
}

.whitespace-pre-wrap {
    white-space: pre-wrap;
}

.font-mono {
    font-family: var(--font-mono);
}

.select-all {
    user-select: all;
}

.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---- Colors ---- */
.text-white {
    color: #fff;
}

.text-slate-200 {
    color: #e2e8f0;
}

.text-slate-300 {
    color: #cbd5e1;
}

.text-slate-400 {
    color: var(--text-secondary);
}

.text-slate-500 {
    color: var(--text-muted);
}

.text-indigo {
    color: var(--indigo-400);
}

.text-emerald {
    color: var(--emerald-400);
}

.text-rose {
    color: var(--rose-400);
}

.text-purple {
    color: var(--purple-400);
}

.text-blue {
    color: var(--blue-400);
}

.text-yellow {
    color: var(--yellow-400);
}

.text-red {
    color: var(--red-400);
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition-slow);
}

.card-hover:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-interactive {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-interactive:hover {
    transform: translateY(-2px);
}

/* ---- Tool Cards (Home Page) ---- */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: var(--transition-slow);
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-lg);
}

.tool-card:hover {
    background: #1a202c;
    transform: translateY(-4px);
}

.tool-card.tool-tiktok:hover {
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: var(--shadow-glow-rose);
}

.tool-card.tool-stock:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow-glow-indigo);
}

.tool-card.tool-suno:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: var(--shadow-glow-emerald);
}

.tool-card-bg-icon {
    position: absolute;
    top: 0;
    right: 0;
    padding: 16px;
    opacity: 0.05;
    transition: var(--transition-slow);
}

.tool-card:hover .tool-card-bg-icon {
    opacity: 0.1;
    transform: scale(1.1);
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: var(--transition);
}

.tool-card-icon.icon-rose {
    background: var(--rose-900);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--rose-400);
}

.tool-card-icon.icon-indigo {
    background: var(--indigo-900);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--indigo-400);
}

.tool-card-icon.icon-emerald {
    background: var(--emerald-900);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--emerald-400);
}

.tool-card:hover .icon-rose {
    background: var(--rose-500);
    color: #fff;
}

.tool-card:hover .icon-indigo {
    background: var(--indigo-500);
    color: #fff;
}

.tool-card:hover .icon-emerald {
    background: var(--emerald-500);
    color: #fff;
}

.tool-card-arrow {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.tool-card:hover .tool-card-arrow {
    transform: translateX(8px);
}

/* ---- Sub Cards (Guide, Admin links) ---- */
.sub-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition-slow);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-lg);
}

.sub-card:hover {
    background: #1a202c;
}

.sub-card.sub-guide:hover {
    border-color: rgba(16, 185, 129, 0.4);
}

.sub-card.sub-admin:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.sub-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.sub-card-icon.icon-emerald {
    background: var(--emerald-900);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--emerald-400);
}

.sub-card-icon.icon-indigo {
    background: var(--indigo-900);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--indigo-400);
}

.sub-card:hover .sub-card-icon.icon-emerald {
    background: var(--emerald-500);
    color: #fff;
}

.sub-card:hover .sub-card-icon.icon-indigo {
    background: var(--indigo-500);
    color: #fff;
}

.sub-card-arrow {
    flex-shrink: 0;
    transition: var(--transition);
}

.sub-card:hover .sub-card-arrow {
    transform: translateX(4px);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-xl {
    padding: 16px 32px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--indigo-600), var(--blue-600));
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--indigo-500), var(--blue-500));
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--emerald-600), #0d9488);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--emerald-500), #14b8a6);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-400);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-purple {
    background: linear-gradient(135deg, var(--purple-600), #ec4899);
    color: #fff;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.25);
}

.btn-purple:hover {
    background: linear-gradient(135deg, var(--purple-500), #f472b6);
}

.btn-rose {
    background: linear-gradient(135deg, var(--rose-600), #ec4899);
    color: #fff;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.25);
}

.btn-rose:hover {
    background: linear-gradient(135deg, var(--rose-500), #f472b6);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}

.btn-ghost:hover {
    color: var(--text-primary);
}

.btn-outline {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-outline:hover {
    background: var(--border-primary);
    color: var(--text-primary);
}

.btn-back {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
}

.btn-back:hover {
    background: var(--border-primary);
    color: var(--text-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ---- Toggle Buttons / Tabs ---- */
.tab-group {
    display: flex;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
}

.tab-btn.active-indigo {
    background: var(--indigo-600);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.tab-btn.active-purple {
    background: var(--purple-600);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.tab-btn.active-emerald {
    background: var(--emerald-600);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.tab-btn.active-blue {
    background: var(--blue-600);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.tab-btn.active-rose {
    background: var(--rose-600);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.tab-btn:not([class*="active"]):hover {
    color: var(--text-primary);
}

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: 16px;
}

.form-group label,
.form-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-field,
.select-field,
.textarea-field {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    outline: none;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.input-field:focus,
.select-field:focus,
.textarea-field:focus {
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-field.focus-emerald:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-field.focus-rose:focus {
    border-color: var(--rose-500);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.select-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.select-field option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.textarea-field {
    resize: none;
    min-height: 120px;
    font-family: var(--font-sans);
}

.textarea-mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ---- Chip / Tag Buttons ---- */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-primary);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.chip:hover {
    border-color: var(--border-hover);
}

.chip.chip-active-emerald {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--emerald-500);
    color: var(--emerald-400);
}

.chip.chip-active-blue {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--blue-500);
    color: var(--blue-400);
}

.chip.chip-active-indigo {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--indigo-500);
    color: var(--indigo-400);
}

/* ---- Concept Cards ---- */
.concept-card {
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    background: var(--bg-input);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.concept-card:hover {
    border-color: var(--border-hover);
}

.concept-card.selected {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--indigo-500);
}

.concept-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.concept-card-desc {
    font-size: 0.625rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---- Aspect Ratio Grid ---- */
.ar-btn {
    padding: 8px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-mono);
    text-align: center;
}

.ar-btn:hover {
    border-color: var(--border-hover);
}

.ar-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--indigo-500);
    color: var(--indigo-400);
}

/* ---- Output / Result Cards ---- */
.result-card {
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 12px;
    position: relative;
    transition: var(--transition);
}

.result-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.result-number {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-family: var(--font-mono);
    flex-shrink: 0;
    margin-top: 2px;
}

.result-text {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
    user-select: all;
    white-space: pre-wrap;
    word-break: break-word;
}

.result-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.result-card:hover .result-copy-btn {
    opacity: 1;
}

.result-copy-btn:hover {
    background: var(--border-primary);
    color: var(--text-primary);
}

.result-copy-btn.copied {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
    opacity: 1;
}

/* ---- Suno Output Cards ---- */
.suno-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.suno-card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
}

.suno-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-header-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
    }
}

/* ---- Navbar (Top Right) ---- */
.navbar {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(22, 27, 34, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
}

.navbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-primary);
}

.navbar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
}

.navbar-btn:hover {
    color: var(--indigo-400);
}

.navbar-btn .key-status {
    font-size: 0.625rem;
    font-weight: 700;
}

.navbar-btn .key-status.ok {
    color: var(--emerald-500);
}

.navbar-btn .key-status.no {
    color: var(--red-400);
}

.navbar select {
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    font-family: var(--font-sans);
}

.navbar select option {
    background: var(--bg-secondary);
}

/* ---- Background Decorations ---- */
.bg-gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 384px;
    background: linear-gradient(to bottom, rgba(99, 102, 241, 0.08), transparent);
    pointer-events: none;
}

.bg-glow-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: rgba(59, 130, 246, 0.04);
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

/* ---- Hero Section ---- */
.hero-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.025em;
}

.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--indigo-400), var(--rose-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.7;
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.9375rem;
    }
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    padding: 16px;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--emerald-400);
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-header-icon {
    color: var(--emerald-400);
}

.modal-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ---- Table ---- */
.data-table {
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

.data-table th {
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 12px 16px;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.3);
}

.data-table .delete-btn {
    opacity: 0;
    transition: var(--transition);
}

.data-table tbody tr:hover .delete-btn {
    opacity: 1;
}

/* ---- Stats Cards ---- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Tag / Badge ---- */
.badge {
    font-size: 0.625rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

/* ---- Accordion (Guide) ---- */
.accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.accordion-trigger:hover {
    background: rgba(30, 41, 59, 0.3);
}

.accordion-trigger-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accordion-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
}

.accordion-icon.c-indigo {
    color: var(--indigo-400);
    background: var(--indigo-900);
    border-color: rgba(99, 102, 241, 0.3);
}

.accordion-icon.c-emerald {
    color: var(--emerald-400);
    background: var(--emerald-900);
    border-color: rgba(16, 185, 129, 0.3);
}

.accordion-icon.c-blue {
    color: var(--blue-400);
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.accordion-icon.c-rose {
    color: var(--rose-400);
    background: var(--rose-900);
    border-color: rgba(244, 63, 94, 0.3);
}

.accordion-icon.c-purple {
    color: var(--purple-400);
    background: var(--purple-900);
    border-color: rgba(168, 85, 247, 0.3);
}

.accordion-icon.c-yellow {
    color: var(--yellow-400);
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.accordion-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.accordion-arrow {
    color: var(--text-secondary);
    transition: var(--transition);
}

.accordion-content {
    padding: 0 20px 20px;
}

.accordion-content-inner {
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ---- TikTok Special Checkbox ---- */
.tiktok-special-box {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.06);
}

.tiktok-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 12px;
}

.tiktok-checkbox-box {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 4px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
}

.tiktok-checkbox-box input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.tiktok-checkbox-box .check-icon {
    color: var(--yellow-400);
}

/* ---- Section Divider ---- */
.divider {
    border-top: 1px solid var(--border-primary);
    padding-top: 16px;
}

/* ---- Alert Box ---- */
.alert-box {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid;
}

.alert-box.alert-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border-color: rgba(99, 102, 241, 0.2);
}

.alert-box.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

/* ---- Utility ---- */
.overflow-y-auto {
    overflow-y: auto;
}

.max-h-250 {
    max-height: 250px;
}

.max-h-500 {
    max-height: 500px;
}

.w-full {
    width: 100%;
}

.h-fit {
    height: fit-content;
}

.relative {
    position: relative;
}

.hidden {
    display: none;
}

.opacity-40 {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(1);
}

/* ---- Loading / Spinner ---- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--indigo-400);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.bounce {
    animation: bounce 0.6s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* ---- Toast Notification ---- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.toast-success {
    border-color: var(--emerald-500);
}

.toast.toast-error {
    border-color: var(--red-500);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Search Input ---- */
.search-input-wrap {
    position: relative;
    flex: 1;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrap input {
    padding-left: 40px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.empty-state svg {
    margin: 0 auto 12px;
}

/* ---- Setup Wizard ---- */
.setup-container {
    max-width: 520px;
    width: 100%;
}

.setup-step {
    display: none;
}

.setup-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setup-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.setup-progress-step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border-primary);
    transition: var(--transition);
}

.setup-progress-step.done {
    background: var(--emerald-500);
}

.setup-progress-step.current {
    background: var(--indigo-500);
}

/* ---- Print ---- */
@media print {

    .navbar,
    .btn-back,
    .modal-overlay {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* ---- Profile Stat Cards ---- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-card-header {
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Additional Tab Color ---- */
.tab-btn.active-orange {
    background: #ea580c;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* ---- Select Focus Variants ---- */
.select-field.focus-emerald:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ---- Button Disabled State ---- */
.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ==========================================
   CUSTOM SELECT (BEAUTIFUL DROPDOWN)
   ========================================== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    text-align: left;
    gap: 8px;
}

.custom-select-trigger:hover {
    border-color: var(--indigo-500);
}

.custom-select-trigger svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

/* Modal Overlay */
.custom-select-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0;
}

@media (min-width: 640px) {
    .custom-select-modal-overlay {
        align-items: center;
        padding: 24px;
    }
}

.custom-select-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Modal Box */
.custom-select-modal {
    background: #1a1f2e;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: 1px solid var(--border-primary);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

@media (min-width: 640px) {
    .custom-select-modal {
        border-radius: var(--radius-xl);
        border-bottom: 1px solid var(--border-primary);
        transform: scale(0.95);
        transition: transform 0.2s ease;
    }
}

.custom-select-modal-overlay.open .custom-select-modal {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .custom-select-modal-overlay.open .custom-select-modal {
        transform: scale(1);
    }
}

/* Modal Header */
.custom-select-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.custom-select-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.custom-select-close {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-primary);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.custom-select-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-400);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Modal Body */
.custom-select-modal-body {
    padding: 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overscroll-behavior: contain;
}

@media (min-width: 480px) {
    .custom-select-modal-body {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Option Cards */
.custom-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid var(--border-primary);
    background: rgba(255,255,255,0.02);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.custom-option:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
}

.custom-option:active {
    background: rgba(99, 102, 241, 0.15);
    transform: scale(0.98);
}

.custom-option.selected {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--indigo-500);
}

.custom-option-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
}

.custom-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.custom-option-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-option.selected .custom-option-label {
    color: var(--indigo-400);
}

.custom-option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}