:root {
    --primary-color: #2563eb;
    --secondary-color: #4f46e5;
    --text-color: #1f2937;
    --light-bg: #f3f4f6;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

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

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

.header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.header p {
    font-size: 1.2rem;
    color: #4b5563;
}

.language-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.lang-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.helper {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

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

.btn-secondary:hover {
    background: var(--light-bg);
}

.loading-state {
    text-align: center;
    padding: 3rem;
}

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

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

.hidden {
    display: none;
}

/* Results Section Styles */
.results-section {
    margin-top: 3rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-item .label {
    font-weight: 500;
    color: #6b7280;
}

.phases-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.phase-card {
    position: relative;
    padding-left: 3rem;
}

.phase-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.phase-details {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
}

.detail-section {
    margin-bottom: 1rem;
}

.detail-section h4 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.phase-meta {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    color: #6b7280;
}

.service-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.service-meta {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    color: #6b7280;
}

.agency-section {
    margin-bottom: 2rem;
}

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

.agency-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.match-score {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--success-color);
    color: white;
    border-radius: 1rem;
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.competitor-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.competitor-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
}

.comp-type {
    padding: 0.25rem 0.5rem;
    background: #e5e7eb;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.creative-list {
    list-style-position: inside;
    margin-top: 1rem;
}

.creative-list li {
    margin-bottom: 0.75rem;
    padding-left: 1rem;
}

.next-steps {
    list-style-position: inside;
    margin: 1rem 0 2rem;
}

.next-steps li {
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .phase-card {
    padding-left: 0;
    padding-right: 3rem;
}

[dir="rtl"] .phase-number {
    left: auto;
    right: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

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

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
