/**
 * Professional Modern Design System
 * Clean, minimalist, tech-savvy UI
 */

:root {
    /* Professional Color Palette */
    --primary: #0a0f1c;
    --primary-light: #1a2332;
    --accent: #0066ff;
    --accent-hover: #0052cc;
    --accent-light: #e6f0ff;
    --success: #00c896;
    --warning: #ffb800;
    --error: #ff3b30;
    --text-primary: #0a0f1c;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
.heading-1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.heading-2 {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.heading-3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.text-body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.text-small {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Container */
.pro-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Header */
.pro-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.pro-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.pro-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.pro-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pro-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pro-nav {
    display: flex;
    gap: 8px;
}

.pro-nav-item {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.pro-nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.pro-nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

/* Hero Section */
.pro-hero {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.pro-hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.pro-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.pro-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pro-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
}

.pro-hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Cards */
.pro-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.pro-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.pro-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pro-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pro-card-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Buttons */
.pro-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.pro-button-primary {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.pro-button-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.pro-button-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.pro-button-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.pro-button-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.pro-button-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.pro-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Input Fields */
.pro-input-group {
    margin-bottom: 24px;
}

.pro-input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pro-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s;
    outline: none;
}

.pro-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

/* Select */
.pro-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.pro-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Toggle Switch */
.pro-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.pro-toggle-item {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.pro-toggle-item.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Grid System */
.pro-grid {
    display: grid;
    gap: 24px;
}

.pro-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.pro-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.pro-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Feature Cards */
.pro-feature-card {
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.pro-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #7c3aed);
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.pro-feature-card:hover::before {
    opacity: 1;
}

.pro-feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pro-feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-light), var(--bg-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.pro-feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pro-feature-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Status Badges */
.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
}

.pro-badge-success {
    background: rgba(0, 200, 150, 0.1);
    color: var(--success);
}

.pro-badge-warning {
    background: rgba(255, 184, 0, 0.1);
    color: var(--warning);
}

.pro-badge-error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--error);
}

.pro-badge-info {
    background: var(--accent-light);
    color: var(--accent);
}

/* Progress Bar */
.pro-progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
}

.pro-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7c3aed);
    border-radius: 100px;
    transition: width 0.3s ease;
}

/* Loading Spinner */
.pro-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Dark Mode Toggle */
.pro-theme-toggle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pro-theme-toggle:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideInUp 0.4s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .pro-hero-title {
        font-size: 2.5rem;
    }

    .pro-hero-actions {
        flex-direction: column;
    }

    .pro-grid-2,
    .pro-grid-3,
    .pro-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #a1a1aa;
        --text-muted: #71717a;
        --bg-primary: #18181b;
        --bg-secondary: #09090b;
        --bg-tertiary: #27272a;
        --border: #27272a;
        --border-light: #3f3f46;
    }

    .pro-header {
        background: rgba(24, 24, 27, 0.95);
    }
}

/* ==================== Deck Type Selector ==================== */
.deck-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.deck-type-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.deck-type-item:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.deck-type-item.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-md);
}

.deck-type-item input {
    display: none;
}

.deck-type-icon {
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.deck-type-item:hover .deck-type-icon {
    transform: scale(1.1);
}

.deck-type-label {
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

/* Dark theme specific fixes for deck type items */
[data-theme="dark"] .deck-type-item {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .deck-type-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

/* Fix contrast for selected items in dark mode */
[data-theme="dark"] .deck-type-item.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

[data-theme="dark"] .deck-type-item.selected .deck-type-label {
    color: white;
    font-weight: 600;
}

[data-theme="dark"] .deck-type-item.selected .deck-type-icon {
    filter: brightness(1.2);
}

/* ==================== Result Cards ==================== */
.result-card {
    display: grid;
    grid-template-columns: auto 80px 1fr;
    gap: 16px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.result-card-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.deck-select-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.result-card-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--accent-light);
    border-radius: 8px;
    font-size: 36px;
}

.result-card-content {
    flex: 1;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.result-card-type {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.result-card-badge {
    padding: 4px 12px;
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.result-card-meta {
    display: flex;
    gap: 20px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.result-card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.result-card-meta-item span:first-child {
    font-size: 1rem;
}

.result-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.result-card-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.result-card-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-1px);
}

.result-card-btn-view {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.result-card-btn-view:hover {
    background: var(--accent);
    color: white;
}

.result-card-btn-download {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border-color: #4caf50;
}

.result-card-btn-download:hover {
    background: #4caf50;
    color: white;
}

.result-card-revision {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.revision-toggle-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
}

.revision-toggle-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.revision-form {
    display: none;
    margin-top: 12px;
    animation: slideDown 0.3s ease;
}

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

.revision-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

.revision-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.revision-submit-btn {
    margin-top: 8px;
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.revision-submit-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* Preview section */
.preview-section {
    margin-top: 32px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-controls {
    display: flex;
    gap: 12px;
}

#resultsGrid {
    display: grid;
    gap: 16px;
}

/* Responsive adjustments for result cards */
@media (max-width: 768px) {
    .result-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-card-checkbox {
        position: absolute;
        top: 16px;
        right: 16px;
    }

    .result-card-preview {
        width: 60px;
        height: 60px;
        margin: 0 auto;
    }

    .result-card-actions {
        flex-direction: column;
    }

    .result-card-btn {
        width: 100%;
        justify-content: center;
    }
}