/* -- Base Reset & Typography -- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-y: auto;
}

.container {
    max-width: 650px;
    width: 100%;
    padding: 1rem 2rem;
    text-align: center;
    margin: auto;
}

/* -- Header & Branding -- */
.logo-container { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 8px; 
}

.nav-logo { 
    width: 42px; 
    height: auto; 
    transition: transform 0.2s ease; 
}

.nav-logo:hover { 
    transform: scale(1.05); 
}

.logo { 
    font-size: 2.5rem; 
    font-weight: 800; 
    color: #f8fafc;
    letter-spacing: -0.04em; 
}

.subtitle { 
    color: #94a3b8; 
    font-size: 1rem; /* Slightly smaller text */
    margin-bottom: 1.25rem; /* Tighter margin */
}

/* -- Dual Feature Cards (EQUAL, Flat Design) -- */
.hero-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px; /* Tighter gap */
    margin-bottom: 15px; /* Tighter margin */
}

.feature-card {
    background-color: #1e293b; 
    border: 1px solid #334155; 
    border-radius: 8px;        
    padding: 14px 16px; /* Reduced internal padding */
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Tighter gap between title and text */
    transition: border-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.feature-text p {
    color: #94a3b8;
    font-size: 0.8rem; /* Slightly smaller description */
    line-height: 1.4; /* Tighter line height */
}

.feature-card:hover {
    border-color: #10b981; /* Emerald-500 accent on hover for BOTH */
    transform: translateY(-2px);
}

.feature-icon {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
    border: 1px solid #334155;
    color: #f8fafc;
}

.feature-text h3 {
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.feature-text p {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (max-width: 550px) {
    .hero-features { grid-template-columns: 1fr; }
}

/* -- Form Inputs -- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Tighter gap between inputs */
}

input[type="url"], input[type="password"], select {
    padding: 0.6rem 1rem; /* Thinner input boxes */
}

button {
    padding: 0.75rem 1.5rem; /* Thinner button */
}

input[type="url"], select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px; 
    color: #f8fafc;
    outline: none;
    transition: all 0.2s ease;
    font-family: ui-monospace, Consolas, monospace;
}

/* Crisp focus ring */
input[type="url"]:focus, select:focus {
    border-color: #10b981; /* Emerald-500 */
    box-shadow: 0 0 0 1px #10b981;
}

/* -- Primary Buttons -- */
button {
    padding: 0.85rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: #10b981; /* Emerald-500 */
    color: #ffffff; 
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover:not(:disabled) { 
    background-color: #059669; /* Emerald-600 */
}

button:active:not(:disabled) {
    transform: translateY(1px);
}

button:disabled {
    background-color: #1e293b;
    color: #64748b; /* Slate-500 */
    border: 1px solid #334155;
    cursor: not-allowed;
}

.generate-btn {
    width: calc(100% - 3rem);
    margin: 0 1.5rem 1.5rem 1.5rem;
}

/* -- Selection UI & Container -- */
.selection-container {
    margin-top: 2rem;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #334155;
    background-color: #0f172a;
}

.back-link {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.back-link:hover:not(:disabled) {
    background-color: transparent;
    color: #f8fafc;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.repo-display {
    font-family: ui-monospace, Consolas, monospace;
    color: #e2e8f0;
    font-size: 0.8rem;
    background-color: #0f172a;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid #334155;
}

/* -- Mode Toggle Bar -- */
.toggle-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #334155;
    background-color: #1e293b;
}

.mode-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

/* -- Pill Groups -- */
.pill-group {
    display: flex;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

.pill {
    flex: 1;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    background: none;
    color: #64748b;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pill:hover:not(.active) {
    background-color: #1e293b;
    color: #94a3b8;
}

.pill.active {
    background-color: #10b981;
    color: #ffffff;
    font-weight: 600;
}

/* -- Export Options Panel -- */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem 1.5rem;
    background-color: #1e293b;
    border-top: 1px solid #334155;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.option-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
    min-width: 80px;
}

.option-row .pill-group {
    flex: 1;
}

.option-row .pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* -- Bulk Actions -- */
.bulk-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #334155;
    font-size: 0.85rem;
    background-color: #0f172a;
}

.hint-text {
    color: #64748b;
}

.hint-text b {
    color: #cbd5e1;
    font-weight: 600;
}

/* -- Tree Items & Folders -- */
.tree-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.85rem;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.tree-item:hover { 
    background-color: #334155; 
}

.folder { font-weight: 600; color: #f8fafc; } 
.file { color: #94a3b8; }

.chevron {
    display: inline-block;
    width: 18px;
    text-align: center;
    font-size: 0.7rem;
    color: #64748b; 
    transition: transform 0.15s ease;
}

.tree-item:hover .chevron { color: #94a3b8; }
.chevron.expanded { transform: rotate(90deg); }

.children-container {
    margin-left: 20px;
    border-left: 1px solid #334155;
    padding-left: 10px;
}

/* -- Custom Checkboxes -- */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #475569; /* Slate-600 */
    border-radius: 4px; 
    background-color: #0f172a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    vertical-align: middle;
    margin-right: 12px;
    transition: all 0.1s ease;
}

input[type="checkbox"]:hover {
    border-color: #94a3b8;
}

input[type="checkbox"]:checked {
    background-color: #10b981; /* Emerald */
    border-color: #10b981;
}

input[type="checkbox"]:checked::after {
    content: "";
    width: 4px;
    height: 8px;
    border: solid #ffffff; 
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* -- Progress Bar -- */
.progress-wrapper {
    margin: 1.5rem;
    padding: 1.25rem;
    border-top: 1px solid #334155;
    background-color: #0f172a;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-family: ui-monospace, Consolas, monospace;
    color: #94a3b8;
    margin-bottom: 8px;
}

.progress-bar-bg {
    height: 6px; 
    background-color: #334155;
    border-radius: 999px; 
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background-color: #10b981; /* Emerald */
    transition: width 0.2s ease;
}

/* -- Status & Errors -- */
.status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid #334155;
    background-color: #1e293b;
}

.status.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.hidden { display: none !important; }

/* -- Footer & Creator Badge -- */
.footer-container {
    margin-top: 20px; /* Reduced from 40px/25px */
    padding: 12px 0 0 0; /* Reduced padding */
    border-top: 1px solid #334155;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Tighter gap between links and badge */
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.social-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    transition: fill 0.2s ease;
}

.social-links a:hover {
    color: #f8fafc;
}

.divider {
    color: #334155;
    margin: 0 16px;
}

.creator-badge {
    color: #64748b;
    font-size: 0.8rem;
}

.creator-badge strong {
    color: #e2e8f0;
    font-weight: 600;
}

/* -- Token Input & Hint -- */
input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px; 
    color: #f8fafc;
    outline: none;
    transition: all 0.2s ease;
    font-family: ui-monospace, Consolas, monospace;
}

input[type="password"]:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981;
}

/* -- Interactive Token & Hint Box -- */
.token-hint-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background-color: #1e293b; /* Slate-800 */
    border: 1px solid #334155; /* Slate-700 */
    border-radius: 6px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #cbd5e1;
    text-align: left;
    transition: all 0.3s ease;
}

.hint-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.hint-content svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.token-hint-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px; /* Thinner padding */
    /* ... keep the rest of your token-hint-box styles ... */
}

.token-hint-box a {
    color: #10b981;
    text-decoration: none;
}

.token-hint-box a:hover {
    color: #34d399;
    text-decoration: underline;
}

/* Expandable Info Accordion */
.token-details {
    margin-left: 26px; /* Aligns with the text, bypassing the icon */
    font-size: 0.75rem;
}

.token-details p {
    margin-top: 8px;
    color: #64748b; /* Slate-500 */
    line-height: 1.5;
}

/* -- New Token Steps Styling -- */
.token-steps {
    margin-top: 8px;
    font-size: 0.75rem;
}

.token-steps strong {
    color: #cbd5e1; /* Slate-300 */
    font-weight: 500;
}

.token-steps ol {
    margin-top: 6px;
    padding-left: 20px;
    color: #64748b; /* Slate-500 */
}

.token-steps li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.token-steps b {
    color: #94a3b8; /* Slate-400 */
    font-weight: 500;
}

.token-details summary {
    cursor: pointer;
    color: #94a3b8; /* Slate-400 */
    font-weight: 500;
    outline: none;
    user-select: none;
    transition: color 0.2s ease;
}

.token-details summary:hover {
    color: #cbd5e1;
}

.token-details p {
    margin-top: 8px;
    color: #64748b; /* Slate-500 */
    line-height: 1.5;
}

/* Error State Overrides */
.token-hint-box.error-state {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #fca5a5;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* -- URL Container & Tab Hint -- */
.url-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.tab-hint {
    font-size: 0.75rem;
    color: #64748b; /* Slate-500 */
    padding-left: 4px;
}

.tab-hint b {
    color: #94a3b8; /* Slate-400 */
    font-weight: 600;
}

@media (pointer: coarse) {
    .tab-hint { display: none; }
}

.token-section {
    margin: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -- Private Token Section (Home Screen) -- */
.private-token-container {
    width: 100%;
}

.private-toggle-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.private-toggle-btn:hover {
    background-color: #273449;
    border-color: #475569;
}

.private-toggle-btn svg {
    color: #94a3b8;
}

.hint-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

/* -- Custom Extension Filter (selection screen) -- */
.custom-ext-container {
    margin: 0 1.5rem;
    padding: 1rem;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-top: none;
}

.custom-ext-title {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: #e2e8f0;
}

.extension-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ext-label {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #1e293b;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #334155;
    cursor: pointer;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.78rem;
    color: #94a3b8;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.ext-label:hover {
    border-color: #10b981;
    color: #e2e8f0;
}
