/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.5rem;
    color: #667eea;
}

.logo-icon {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Main Content */
.main {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 300;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Container */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideInUp 0.8s ease-out 0.4s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar */
.progress-container {
    padding: 2rem 2rem 1rem;
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    width: 33.33%;
    transition: width 0.5s ease;
}

.progress-text {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Form Steps */
.dating-form {
    position: relative;
    min-height: 400px;
}

.form-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.5s ease;
    pointer-events: none;
}

.form-step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.form-step.prev {
    transform: translateX(-100px);
}

.step-content {
    padding: 2rem;
    text-align: center;
}

.step-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.step-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.step-description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 2rem;
}

select {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Kanit', sans-serif;
    background: white;
    color: #333;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 3rem;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

select:valid {
    border-color: #10b981;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Kanit', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-line {
    background: #00c300;
    color: white;
    font-size: 1.1rem;
    padding: 1.2rem 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 195, 0, 0.4);
    margin-bottom: 1rem;
}

.btn-line:hover {
    background: #00a300;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 195, 0, 0.6);
}

.line-icon {
    font-size: 1.2rem;
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Result Summary */
.result-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e1e5e9;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: #666;
}

.summary-value {
    font-weight: 600;
    color: #333;
}

/* CTA Container */
.cta-container {
    margin-bottom: 2rem;
}

.cta-note {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    color: #666;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #764ba2;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .main {
        padding: 1rem 0 2rem;
        min-height: calc(100vh - 160px);
    }
    
    .hero {
        margin-bottom: 2rem;
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .form-container {
        margin: 0 10px;
        border-radius: 15px;
        max-width: calc(100vw - 20px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    }
    
    .step-content {
        padding: 1.5rem 1.2rem;
    }
    
    .progress-container {
        padding: 1.2rem 1.5rem 1rem;
    }
    
    .step-title {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }
    
    .step-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }
    
    .step-icon {
        font-size: 3.5rem;
        margin-bottom: 1rem;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    select {
        padding: 1rem 1.2rem;
        padding-right: 3rem;
        font-size: 1rem;
        min-height: 48px;
        border-radius: 10px;
    }
    
    .input-group {
        margin-bottom: 1.5rem;
    }
    
    .result-summary {
        padding: 1.2rem;
        margin-bottom: 1.5rem;
        border-radius: 10px;
    }
    
    .summary-item {
        padding: 0.8rem 0;
        font-size: 0.95rem;
    }
    
    .cta-container {
        margin-bottom: 1.5rem;
    }
    
    .btn-line {
        font-size: 1.1rem;
        padding: 1.2rem 2rem;
        min-height: 52px;
    }
    
    .cta-note {
        font-size: 0.85rem;
        margin-top: 0.8rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer {
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .form-container {
        margin: 0 5px;
        border-radius: 12px;
        max-width: calc(100vw - 10px);
    }
    
    .step-content {
        padding: 1.2rem 1rem;
    }
    
    .progress-container {
        padding: 1rem 1.2rem 0.8rem;
    }
    
    .progress-text {
        font-size: 0.85rem;
    }
    
    .step-icon {
        font-size: 3rem;
        margin-bottom: 0.8rem;
    }
    
    .step-title {
        font-size: 1.25rem;
        margin-bottom: 0.6rem;
    }
    
    .step-description {
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }
    
    .btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
        max-width: 100%;
        min-height: 44px;
    }
    
    .btn-line {
        font-size: 1rem;
        padding: 1rem 1.5rem;
        min-height: 48px;
    }
    
    select {
        padding: 0.9rem 1rem;
        padding-right: 2.8rem;
        font-size: 0.95rem;
        min-height: 44px;
        border-radius: 8px;
    }
    
    .result-summary {
        padding: 1rem;
        margin-bottom: 1.2rem;
    }
    
    .summary-item {
        padding: 0.6rem 0;
        font-size: 0.9rem;
    }
    
    .summary-label,
    .summary-value {
        font-size: 0.9rem;
    }
    
    .cta-note {
        font-size: 0.8rem;
    }
    
    .footer {
        padding: 1.2rem 0;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .hero-title {
        font-size: 1.6rem;
    }
    
    .form-container {
        margin: 0 2px;
        max-width: calc(100vw - 4px);
    }
    
    .step-content {
        padding: 1rem 0.8rem;
    }
    
    .progress-container {
        padding: 0.8rem 1rem 0.6rem;
    }
    
    .step-title {
        font-size: 1.1rem;
    }
    
    .step-description {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-line {
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }
    
    select {
        padding: 0.8rem 0.9rem;
        padding-right: 2.5rem;
        font-size: 0.9rem;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .main {
        padding: 0.5rem 0 1rem;
    }
    
    .hero {
        margin-bottom: 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .step-content {
        padding: 1rem;
    }
    
    .step-icon {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
    
    .step-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .step-description {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    select:hover {
        transform: none;
    }
    
    select:focus {
        transform: none;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
select:focus,
.btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border: 2px solid #fff;
    }
    
    .form-container {
        border: 2px solid #000;
    }
}
