/* Airbnb-Inspired Design System */

/* Import Google Fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties (Airbnb-style color palette) */
:root {
    --color-primary: #FF5A5F;
    --color-primary-dark: #E1484C;
    --color-secondary: #00A699;
    --color-background: #FFFFFF;
    --color-background-light: #F7F7F7;
    --color-text-primary: #222222;
    --color-text-secondary: #717171;
    --color-text-light: #B0B0B0;
    --color-border: #DDDDDD;
    --color-border-light: #EBEBEB;
    --color-success: #00A699;
    --color-warning: #FC642D;
    
    --border-radius: 12px;
    --border-radius-small: 8px;
    --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-large: 0 4px 16px rgba(0, 0, 0, 0.12);
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-background-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* Header Styling */
header {
    background: var(--color-background);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-medium);
    text-align: center;
}

.brand {
    margin-bottom: var(--spacing-xl);
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-success);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

header p {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.instructions {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-success);
    border-radius: var(--border-radius-small);
    border: 1px solid var(--color-success);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.instructions p {
    font-size: 1rem;
    margin: 0;
    color: white;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

/* Form Styling */
.test-form {
    background: var(--color-background);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-medium);
}

.questions-container {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.questions-container .question {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* Question Cards */
.question {
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.current-question {
    opacity: 1;
    transform: translateX(0);
}

.question:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.question-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.4;
}

.question-number {
    display: inline-block;
    background: var(--color-success);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-small);
    margin-right: var(--spacing-sm);
    min-width: 32px;
    text-align: center;
}

/* Response Options */
.options {
    display: grid;
    gap: var(--spacing-sm);
}

.option {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--color-background-light);
    border: 2px solid var(--color-border-light);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    position: relative;
}

.option:hover {
    border-color: var(--color-success);
    background: rgba(0, 166, 153, 0.05);
}

.option.selected {
    border-color: var(--color-success);
    background: rgba(0, 166, 153, 0.15);
    font-weight: 600;
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

.option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    margin-right: var(--spacing-md);
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.option input[type="radio"]:checked {
    border-color: var(--color-success);
    background: var(--color-success);
}

.option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    height: 8px;
    background: var(--color-border-light);
    border-radius: 4px;
    margin: var(--spacing-xl) 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), var(--color-secondary));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 0%;
}

.progress-text {
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 600;
}

/* Buttons */
.submit-btn, .restart-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.submit-btn:disabled {
    background: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
}

.submit-btn:not(:disabled):hover, .restart-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* Results Section */
.results {
    background: var(--color-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-large);
}

.results-header {
    padding: var(--spacing-xxl) var(--spacing-xl);
    text-align: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.results-header p {
    font-size: 1.125rem;
    opacity: 0.9;
}

.factor-results {
    padding: var(--spacing-xl);
}

/* Factor Cards */
.factor {
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transition: all 0.3s ease;
}

.factor:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--color-border);
}

.factor-name {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
}

.factor-name::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--color-success);
    border-radius: 2px;
    margin-right: var(--spacing-md);
}

.factor-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-success);
}

.score-percentage {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.score-bar {
    height: 8px;
    background: var(--color-border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), var(--color-secondary));
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Results Footer */
.results-footer {
    padding: var(--spacing-xl);
    text-align: center;
    background: var(--color-background-light);
    border-top: 1px solid var(--color-border-light);
}

.powered-by {
    margin-top: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.powered-by strong {
    color: var(--color-success);
    font-weight: 600;
}

/* Responsive Design - Mobile First */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        padding: var(--spacing-lg);
    }
    
    .options {
        grid-template-columns: 1fr 1fr;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        padding: var(--spacing-xl);
    }
    
    header {
        padding: var(--spacing-xxl) var(--spacing-xxl);
    }
    
    .logo {
        font-size: 3rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .instructions {
        padding: var(--spacing-lg) var(--spacing-xl);
        margin-top: var(--spacing-xl);
    }
    
    .instructions p {
        font-size: 1.125rem;
    }
    
    .test-form {
        padding: var(--spacing-xxl);
    }
    
    .options {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .factor-results {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--spacing-lg);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .options {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .option {
        padding: var(--spacing-md) var(--spacing-sm);
        text-align: center;
        flex-direction: column;
        justify-content: center;
        min-height: 80px;
    }
    
    .option input[type="radio"] {
        margin-right: 0;
        margin-bottom: var(--spacing-xs);
    }
    
    .factor-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .factor-results {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question {
    animation: fadeInUp 0.6s ease;
}

.factor {
    animation: slideInLeft 0.8s ease;
}

.factor:nth-child(2) {
    animation-delay: 0.2s;
}

.factor:nth-child(3) {
    animation-delay: 0.4s;
}

.factor:nth-child(4) {
    animation-delay: 0.6s;
}

.factor:nth-child(5) {
    animation-delay: 0.8s;
}

/* Focus States for Accessibility */
.option:focus-within {
    outline: 2px solid var(--color-success);
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid var(--color-success);
    outline-offset: 2px;
}

/* Ad Container Styling */
.ad-container {
    margin: var(--spacing-lg) 0;
    text-align: center;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-small);
    background: var(--color-background-light);
}

.results-ad {
    margin: var(--spacing-xl) var(--spacing-lg);
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-lg);
    gap: var(--spacing-md);
}

.nav-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--color-border);
    background: var(--color-background);
    color: var(--color-text-primary);
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    min-width: 80px;
}

.nav-btn:hover:not(:disabled) {
    border-color: var(--color-success);
    background: var(--color-success);
    color: white;
    transform: translateY(-1px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-background-light);
    color: var(--color-text-light);
}

.prev-btn {
    margin-right: auto;
}

.next-btn {
    margin-left: auto;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}