/* Base styles esistenti di form.php */
body {
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 50%, #2d2d30 100%);
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

.form-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.form-header h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #b3b3b3;
    font-size: 18px;
    font-weight: 300;
}

/* Method Selection Styles */
.method-selection {
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.method-selection h2 {
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.method-selection > p {
    color: #b3b3b3;
    font-size: 16px;
    margin-bottom: 40px;
}

.method-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.method-card {
    background: rgba(60, 60, 60, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.method-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.ai-card:hover {
    border-color: rgba(76, 175, 80, 0.5);
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.2);
}

.manual-card:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.method-card h3 {
    color: #ffffff;
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.method-card > p {
    color: #d1d1d1;
    margin-bottom: 20px;
    line-height: 1.5;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.features-list li {
    color: #b3b3b3;
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
    font-size: 14px;
}

.features-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

.select-method-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.ai-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
}

.select-method-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.ai-btn:hover {
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4) !important;
}

/* Generation Sections */
.generation-section {
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease-out;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.section-header h2 {
    color: #ffffff;
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

/* AI Section Styles */
.ai-form-container > p {
    color: #d1d1d1;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
}

.ai-generate-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    width: 100%;
    justify-content: center;
}

.ai-generate-btn:hover {
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4) !important;
}

.ai-info {
    text-align: center;
    margin-top: 20px;
    color: #4CAF50;
    font-weight: 500;
    font-size: 14px;
}

/* Manual Section - mantieni tutti gli stili esistenti di form.php */
.prompt-container {
    background: rgba(20, 20, 20, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 25px;
}

.prompt-header {
    background: rgba(60, 60, 60, 0.6);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prompt-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
}

.copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.prompt-box {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.prompt-box pre {
    margin: 0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: #e8e8e8;
}

.instructions {
    background: rgba(102, 126, 234, 0.1);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.instructions h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #ffffff;
    font-weight: 600;
}

.instructions ol {
    margin: 0;
    padding-left: 20px;
    color: #d1d1d1;
}

.instructions li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Shared Styles */
.examples-section {
    margin: 25px 0;
}

.examples-section h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 600;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.example-card {
    background: rgba(60, 60, 60, 0.4);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-card:hover {
    background: rgba(60, 60, 60, 0.6);
    transform: translateY(-2px);
}

.example-card strong {
    color: #667eea;
    font-weight: 600;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #ffffff;
    font-size: 16px;
}

.form-group label small {
    display: block;
    font-weight: 400;
    color: #b3b3b3;
    margin-top: 5px;
    font-size: 14px;
}

textarea {
    width: 100%;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: rgba(20, 20, 20, 0.8);
    color: #e8e8e8;
    box-sizing: border-box;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3);
}

#json_data {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    min-height: 350px;
}

.form-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.btn-primary, .btn-secondary {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* Template section styles esistenti */
.template-section {
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.template-section h2 {
    color: #ffffff;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
}

.template-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.template-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.info-card {
    background: rgba(60, 60, 60, 0.4);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.info-card:hover {
    background: rgba(60, 60, 60, 0.6);
}

.info-card h3 {
    margin: 0 0 15px 0;
    color: #ffffff;
    font-weight: 600;
}

.info-card p {
    color: #d1d1d1;
    line-height: 1.6;
    margin-bottom: 15px;
}

.info-card code {
    background: rgba(20, 20, 20, 0.8);
    padding: 15px;
    border-radius: 8px;
    font-size: 12px;
    display: block;
    margin-top: 15px;
    word-break: break-all;
    color: #e8e8e8;
    font-family: 'Fira Code', 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.4;
}

.btn-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
}

.btn-link:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.validation-message {
    margin-top: 15px;
    padding: 15px 20px;
    border-radius: 10px;
    display: none;
    font-weight: 500;
}

.validation-message.success {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.validation-message.error {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .form-header h1 {
        font-size: 2rem;
    }

    .method-cards {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

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

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