/* ========================================
   Pubblica Progetto Page Styles
   ======================================== */

/* Hero Section */
.publish-hero {
    position: relative;
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(180deg, #1E3A8A 0%, #3B82F6 50%, #1E40AF 100%);
    overflow: hidden;
    padding: var(--space-2xl) 0;
}

.publish-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-xl);
    width: 100%;
    max-width: 1100px;
    align-items: start;
}

/* Publish Card */
.publish-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

[data-theme="dark"] .publish-card {
    background: rgba(30, 41, 59, 0.98);
}

/* Header */
.publish-header {
    text-align: center;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

[data-theme="dark"] .publish-header {
    background: var(--bg-primary);
}

.publish-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    color: #fff;
}

.publish-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.publish-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Progress Steps */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.step-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.progress-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.progress-step.completed .step-number {
    background: #10B981;
    border-color: #10B981;
    color: #fff;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.progress-step.active .step-label {
    color: var(--primary);
}

.progress-step.completed .step-label {
    color: #10B981;
}

.progress-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 var(--space-md);
    margin-bottom: 20px;
    transition: background var(--transition-base);
}

.progress-line.completed {
    background: #10B981;
}

/* Form */
.publish-form {
    padding: var(--space-xl);
}

.form-step {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

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

/* Form Elements */
.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

.form-hint {
    display: block;
    margin-top: var(--space-xs);
    font-size: 12px;
    color: var(--text-muted);
}

.required {
    color: #EF4444;
}

/* Project Type Selector */
.project-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.project-type {
    cursor: pointer;
}

.project-type input {
    display: none;
}

.project-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    text-align: center;
}

.project-type-card svg {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.project-type input:checked + .project-type-card {
    border-color: var(--primary);
    background: rgba(30, 58, 138, 0.05);
}

[data-theme="dark"] .project-type input:checked + .project-type-card {
    background: rgba(59, 130, 246, 0.1);
}

.project-type input:checked + .project-type-card svg {
    color: var(--primary);
}

.project-type-card:hover {
    border-color: var(--primary-light);
}

.project-type-card .type-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Tech Selector */
.tech-selector {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.tech-category {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.tech-category-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.tech-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.tech-option {
    cursor: pointer;
}

.tech-option input {
    display: none;
}

.tech-chip {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.tech-chip:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
}

.tech-option input:checked + .tech-chip {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .tech-option input:checked + .tech-chip {
    background: rgba(245, 158, 11, 0.15);
}

/* Budget Selector */
.budget-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.budget-option {
    cursor: pointer;
}

.budget-option input {
    display: none;
}

.budget-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    text-align: center;
}

.budget-card:hover {
    border-color: var(--primary-light);
}

.budget-option input:checked + .budget-card {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.05);
}

[data-theme="dark"] .budget-option input:checked + .budget-card {
    background: rgba(245, 158, 11, 0.1);
}

.budget-range {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.budget-option input:checked + .budget-card .budget-range {
    color: var(--accent);
}

.budget-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}

.btn-next,
.btn-publish {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 28px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: auto;
}

.btn-next:hover,
.btn-publish:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-next svg,
.btn-publish svg {
    transition: transform var(--transition-fast);
}

.btn-next:hover svg {
    transform: translateX(4px);
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-back:hover svg {
    transform: translateX(-4px);
}

.btn-back svg {
    transition: transform var(--transition-fast);
}

/* Sidebar */
.publish-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.sidebar-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: #fff;
    margin-bottom: var(--space-md);
}

.sidebar-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: var(--space-xs);
}

.sidebar-card p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* Success State */
.publish-success {
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 50%;
    color: #fff;
}

.success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.success-text {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.btn-outline-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-outline-success:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-new-project {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-new-project:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .publish-container {
        grid-template-columns: 1fr;
        max-width: 640px;
    }

    .publish-sidebar {
        display: none;
    }

    .budget-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .publish-hero {
        padding: var(--space-lg);
    }

    .publish-header {
        padding: var(--space-lg);
    }

    .publish-title {
        font-size: 24px;
    }

    .progress-steps {
        padding: var(--space-md);
    }

    .step-label {
        display: none;
    }

    .progress-line {
        width: 40px;
        margin-bottom: 0;
    }

    .publish-form {
        padding: var(--space-lg);
    }

    .project-type-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .budget-selector {
        grid-template-columns: 1fr;
    }

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

    .btn-next,
    .btn-publish {
        margin-left: 0;
        width: 100%;
    }

    .btn-back {
        width: 100%;
        order: 1;
    }

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

    .btn-outline-success,
    .btn-new-project {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .publish-hero {
        padding: var(--space-md);
    }

    .publish-form {
        padding: var(--space-md);
    }

    .publish-title {
        font-size: 22px;
    }

    .project-type-selector {
        grid-template-columns: 1fr;
    }

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