/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Catppuccin Dark Theme Colors */
    --bg-primary: #1e1e2e;
    --bg-secondary: #181825;
    --bg-tertiary: #11111b;
    --surface: #313244;
    --surface-hover: #45475a;
    --text-primary: #cdd6f4;
    --text-secondary: #bac2de;
    --text-muted: #a6adc8;
    --accent: #cba6f7;
    --accent-hover: #b4befe;
    --success: #a6e3a1;
    --warning: #f9e2af;
    --error: #f38ba8;
    --blue: #89b4fa;
    --pink: #f5c2e7;
    --mauve: #cba6f7;
    --lavender: #b4befe;
    --sapphire: #74c7ec;
    --sky: #89dceb;
    --teal: #94e2d5;
    --green: #a6e3a1;
    --yellow: #f9e2af;
    --peach: #fab387;
    --maroon: #eba0ac;
    --red: #f38ba8;
    --flamingo: #f2cdcd;
    --rosewater: #f5e0dc;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: black;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 3rem 0 2rem;
    color: var(--text-primary);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 3rem;
    color: var(--peach);
}

.logo h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--lavender) 0%, var(--pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Main Content */
.main-content {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--surface);
}

/* Version Selector */
.version-selector {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--surface);
}

.version-btn {
    flex: 1;
    padding: 1.5rem;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.version-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.version-btn.active {
    background: var(--bg-primary);
    color: var(--accent);
    border-bottom: 3px solid var(--accent);
}

.version-btn i {
    font-size: 1.2rem;
}

/* Form Container */
.form-container {
    display: none;
    padding: 2rem;
}

.form-container.active {
    display: block;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Form Styles */
.patcher-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label i {
    color: var(--accent);
    width: 16px;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid var(--surface);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(203, 166, 247, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group small {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Ensure consistent sizing for all form elements */
.form-group input,
.form-group select,
.custom-select {
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid var(--surface);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.select-trigger:focus-within {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(203, 166, 247, 0.1);
}

/* Section Headers */
/* Features Section */
.features-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid rgba(203, 166, 247, 0.2);
}

.features-section h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.features-section h3 i {
    color: var(--mauve);
}

.feature-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.feature-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-checkbox:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.feature-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: relative;
    height: 24px;
    width: 24px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    border: 2px solid var(--text-muted);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.feature-checkbox:hover .checkmark {
    border-color: var(--accent);
}

.feature-checkbox input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid var(--bg-tertiary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.feature-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.feature-info {
    flex: 1;
}

.feature-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.feature-info small {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.jar-urls {
    margin-bottom: 2rem;
}

.jar-urls h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.jar-urls h3 i {
    color: var(--accent);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--mauve) 0%, var(--blue) 100%);
    color: var(--bg-primary);
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(203, 166, 247, 0.3);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--surface-hover);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-primary);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 1rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--surface);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.success-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-icon {
    color: var(--success);
}

.error-icon {
    color: var(--error);
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .version-selector {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 2rem 0 1rem;
    }

    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .form-container {
        padding: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .parameter-item {
        text-align: left;
    }
}

/* Workflow Instructions Styles */
.workflow-instructions {
    text-align: left;
    max-width: 100%;
}

.workflow-instructions h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workflow-instructions h4 {
    color: #34495e;
    margin: 1.5rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.steps {
    margin: 1.5rem 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.step-number {
    background: #3498db;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin: 0 0 0.5rem;
    color: #2c3e50;
}

.step-detail {
    color: #7f8c8d !important;
    font-size: 0.9rem;
}

.parameters-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.parameters {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.parameter-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.parameter-item strong {
    color: #2c3e50;
    font-size: 0.9rem;
}

.parameter-value {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    color: #495057;
}

.note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #e8f4fd;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.note i {
    color: #3498db;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.note strong {
    color: #2c3e50;
}

.note p {
    margin: 0;
    color: #34495e;
}

/* Success Modal Styles */
.success-content {
    text-align: center;
    max-width: 100%;
}

.success-content h3 {
    color: #27ae60;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.success-content p {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.success-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 160px;
    justify-content: center;
}

.success-actions .btn-primary {
    background: #3498db;
    color: white;
    border: none;
}

.success-actions .btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.success-actions .btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
}

.success-actions .btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .success-actions {
        flex-direction: column;
        align-items: center;
    }

    .success-actions .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Custom Searchable Dropdowns */
.custom-select {
    position: relative;
    width: 100%;
}

.select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--surface-hover);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 52px; /* Consistent height */
    width: 100%;
    box-sizing: border-box;
}

.select-trigger:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(203, 166, 247, 0.1);
}

.select-trigger.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(203, 166, 247, 0.2);
}

.select-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
}

.select-input::placeholder {
    color: var(--text-muted);
}

.select-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    margin-left: 12px;
}

.select-trigger.active .select-arrow {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 2px solid var(--surface-hover);
    border-radius: 12px;
    margin-top: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-height: 300px;
    overflow: hidden;
}

.select-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-container {
    padding: 12px;
    border-bottom: 1px solid var(--surface-hover);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--surface-hover);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(203, 166, 247, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.options-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px 0;
}

.options-list::-webkit-scrollbar {
    width: 6px;
}

.options-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.options-list::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 3px;
}

.options-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.option:hover {
    background: var(--surface-hover);
    border-left-color: var(--accent);
    padding-left: 20px;
}

.option.selected {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 500;
    border-left-color: var(--accent-hover);
}

.option.no-results {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
    text-align: center;
    padding: 20px 16px;
}

.option.no-results:hover {
    background: transparent;
    border-left-color: transparent;
    padding-left: 16px;
}

.option.group-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px 4px;
    cursor: default;
    border-bottom: 1px solid var(--surface-hover);
    margin-bottom: 4px;
}

.option.group-label:hover {
    background: transparent;
    border-left-color: transparent;
    padding-left: 16px;
}

/* Highlight matching text */
.option .highlight {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Responsive adjustments for dropdowns */
@media (max-width: 768px) {
    .select-options {
        max-height: 250px;
    }

    .options-list {
        max-height: 190px;
    }

    .option {
        padding: 14px 16px;
        font-size: 16px;
    }
}

/* Focus states for accessibility */
.select-trigger:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(203, 166, 247, 0.2);
}

.search-input:focus {
    border-color: var(--accent);
}

/* Loading state */
.select-trigger.loading {
    opacity: 0.7;
    pointer-events: none;
}

.select-trigger.loading::after {
    content: '';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Readonly input styling */
.readonly-input {
    background: var(--surface) !important;
    cursor: not-allowed !important;
    opacity: 0.8;
    font-weight: 500;
    color: var(--text-secondary) !important;
}

.readonly-input::placeholder {
    color: var(--text-muted) !important;
}