/* Nawina Lotto - Main Stylesheet */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout Components */
.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 15px 0 10px;
    color: white;
}

.header h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 5px;
    color: #F59E0B;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
}

.header p {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    opacity: 0.9;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: center;
    margin: 15px 0 20px;
    padding: 0 20px;
}

.progress-step {
    width: clamp(35px, 8vw, 40px);
    height: clamp(35px, 8vw, 40px);
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 clamp(5px, 2vw, 10px);
    font-weight: bold;
    position: relative;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #22C55E;
    transform: scale(1.1);
}

.progress-step.completed {
    background: #F59E0B;
}

/* Main Content Area */
.main-content {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: clamp(20px, 5vw, 30px);
    box-shadow: 0 -5px 30px rgba(0,0,0,0.2);
    flex-grow: 1;
    min-height: 60vh;
    position: relative;
}

/* Step Navigation */
.step {
    display: none;
    animation: slideIn 0.3s ease-in-out;
}

.step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step h2 {
    text-align: center;
    margin-bottom: clamp(20px, 5vw, 30px);
    color: #1e3c72;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 600;
}

/* Ticket Components */
.ticket-grid {
    display: grid;
    gap: clamp(10px, 3vw, 15px);
    margin-bottom: 20px;
}

.ticket-card {
    border: 2px solid #e5e5e5;
    border-radius: 15px;
    padding: clamp(15px, 4vw, 20px);
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #f8f9fa, #ffffff);
    touch-action: manipulation;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ticket-card:active {
    transform: scale(0.98);
}

.ticket-card:hover,
.ticket-card:focus {
    border-color: #22C55E;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.15);
}

.ticket-card.selected {
    border-color: #22C55E;
    background: linear-gradient(45deg, #dcfce7, #f0fdf4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.2);
}

.ticket-card.selected::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 15px;
    background: #22C55E;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.ticket-price {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: bold;
    color: #F59E0B;
    margin-bottom: 8px;
}

.ticket-details {
    color: #666;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    margin-bottom: 5px;
}

.ticket-bonus {
    color: #22C55E;
    font-weight: bold;
    font-size: clamp(0.8rem, 2.2vw, 0.9rem);
}

/* Form Components */
.phone-input-container {
    margin: clamp(20px, 5vw, 30px) 0;
}

.phone-input-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1e3c72;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.phone-input {
    width: 100%;
    padding: clamp(12px, 3vw, 15px);
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: clamp(1rem, 3vw, 1.1rem);
    transition: border-color 0.3s;
    background: #fafafa;
    -webkit-appearance: none;
    appearance: none;
}

.phone-input:focus {
    outline: none;
    border-color: #22C55E;
    background: white;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.phone-input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.error-message {
    color: #ef4444;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    margin-top: 8px;
    display: none;
    padding: 8px;
    background: #fef2f2;
    border-radius: 8px;
    border-left: 3px solid #ef4444;
}

/* Button Styles */
.btn {
    width: 100%;
    padding: clamp(12px, 3vw, 15px);
    border: none;
    border-radius: 12px;
    font-size: clamp(1rem, 3vw, 1.1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    touch-action: manipulation;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(45deg, #22C55E, #16a34a);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af;
    box-shadow: none;
}

/* Summary Component */
.selected-ticket-summary {
    background: linear-gradient(45deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    padding: clamp(15px, 4vw, 20px);
    margin-bottom: 20px;
    border-left: 4px solid #F59E0B;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.selected-ticket-summary h3 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 600;
}

.selected-ticket-summary p {
    margin: 5px 0;
    color: #555;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: clamp(25px, 6vw, 40px);
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 600;
}

.modal-content > p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.modal-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: clamp(12px, 3vw, 15px);
    margin: 20px 0;
    text-align: left;
    border: 1px solid #e5e5e5;
}

.modal-details p {
    margin: 8px 0;
    font-size: clamp(0.85rem, 2.3vw, 0.95rem);
    color: #555;
}

/* Processing Components */
.processing-step {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e5e5;
    border-top: 4px solid #22C55E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Responsive Design */

/* Small Mobile Devices */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .main-content {
        border-radius: 15px 15px 0 0;
        padding: 20px 15px;
    }
    
    .ticket-grid {
        gap: 12px;
    }
    
    .ticket-card {
        padding: 15px;
        min-height: 75px;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 360px) {
    .progress-bar {
        padding: 0 10px;
    }
    
    .ticket-card {
        padding: 12px;
    }
    
    .main-content {
        padding: 15px 12px;
    }
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .container {
        max-width: 500px;
        padding: 20px;
    }
    
    .main-content {
        border-radius: 20px;
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .phone-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .main-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .step h2 {
        color: #e5e7eb;
    }
    
    .ticket-card {
        background: linear-gradient(45deg, #374151, #4b5563);
        border-color: #6b7280;
        color: #f9fafb;
    }
    
    .ticket-details {
        color: #d1d5db;
    }
    
    .phone-input {
        background: #374151;
        border-color: #6b7280;
        color: #f9fafb;
    }
    
    .selected-ticket-summary {
        background: linear-gradient(45deg, #374151, #4b5563);
        color: #f9fafb;
    }
    
    .selected-ticket-summary h3 {
        color: #e5e7eb;
    }
    
    .modal-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .modal-details {
        background: #374151;
        border-color: #6b7280;
    }
}