/* Reset e stili base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: #8B0000;
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo-header {
    text-align: center;
}

.logo-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.logo-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.back-button {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s;
}

.back-button:hover {
    opacity: 0.8;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Home Page */
.welcome-section {
    text-align: center;
    padding: 3rem 0;
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #8B0000;
}

.visitor-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.visitor-card {
    background: white;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-decoration: none;
    color: #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.visitor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.visitor-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #8B0000;
}

.visitor-card p {
    color: #666;
    line-height: 1.5;
}

/* Selection Page */
.selection-steps {
    max-width: 900px;
    margin: 0 auto;
}

.step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step.active {
    display: block;
}

.step h2 {
    text-align: center;
    color: #8B0000;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.option-card:hover {
    border-color: #8B0000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139,0,0,0.1);
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-card input[type="radio"]:checked + span {
    font-weight: bold;
}

.option-card input[type="radio"]:checked ~ * {
    color: #8B0000;
}

.option-card input[type="radio"]:checked + * {
    color: #8B0000;
}

.option-card:has(input[type="radio"]:checked) {
    background: #f8f0f0;
    border-color: #8B0000;
}

/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.step-navigation button {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prev-step {
    background: #6c757d;
    color: white;
}

.prev-step:hover {
    background: #5a6268;
}

.next-step, .submit-button {
    background: #8B0000;
    color: white;
    margin-left: auto;
}

.next-step:hover:not(:disabled), .submit-button:hover:not(:disabled) {
    background: #700000;
}

.skip-step {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    margin-left: auto;
}

.skip-step:hover {
    background: #e0e0e0;
    color: #333;
}

/* Quando c'è solo il bottone Salta (primo step) */
.step:first-child .skip-step {
    margin-left: auto;
    margin-right: 0;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress Bar */
.progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: #e0e0e0;
}

.progress-bar {
    height: 100%;
    background: #8B0000;
    transition: width 0.5s ease;
}

/* Results Page */
.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.results-header h2 {
    color: #8B0000;
    margin-bottom: 1rem;
}

.wine-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.wine-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.wine-card:hover {
    transform: translateY(-5px);
}

.wine-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f8f8;
    padding: 1rem;
}

.wine-info {
    padding: 1.5rem;
}

.wine-info h3 {
    color: #8B0000;
    margin-bottom: 0.5rem;
}

.wine-cantina {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.wine-stand {
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.9rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 10px;
    margin: 2rem auto;
    max-width: 600px;
}

/* Wine Detail Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    overflow-y: auto;
}

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

.modal-content {
    background: white;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 15px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    z-index: 10;
}

.modal-close:hover {
    color: #000;
}

.wine-detail {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    padding: 2rem;
}

.wine-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: #f8f8f8;
    padding: 1rem;
    border-radius: 10px;
}

.wine-detail-info h2 {
    color: #8B0000;
    margin-bottom: 1rem;
}

.wine-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-label {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.spec-value {
    color: #333;
}

.wine-description {
    margin: 2rem 0;
}

.wine-description h3 {
    color: #8B0000;
    margin-bottom: 1rem;
}

/* Search Section */
.search-section {
    margin-top: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.divider span {
    background: #f8f9fa;
    padding: 0 1rem;
    position: relative;
    color: #666;
    font-style: italic;
}

.search-section h3 {
    text-align: center;
    color: #8B0000;
    margin-bottom: 1.5rem;
}

.search-form {
    margin-top: 1rem;
}

.search-input-wrapper {
    display: flex;
    gap: 1rem;
    background: white;
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    outline: none;
    background: transparent;
}

.search-button {
    background: #8B0000;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease;
}

.search-button:hover {
    background: #700000;
}

/* Virtual Keyboard */
.vk-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.vk-modal.active {
    display: flex;
}

.vk-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.vk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.vk-header h3 {
    margin: 0;
    color: #333;
}

.vk-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vk-close:hover {
    color: #333;
}

.vk-display {
    margin-bottom: 2rem;
}

.vk-display input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    background: #f8f9fa;
}

.vk-keyboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vk-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.vk-key {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    min-width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.vk-key:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.vk-key:active {
    transform: translateY(0);
    background: #d0d0d0;
}

.vk-backspace {
    min-width: 80px;
    background: #ffebee;
}

.vk-space {
    min-width: 300px;
}

.vk-enter {
    min-width: 150px;
    background: #8B0000;
    color: white;
}

.vk-enter:hover {
    background: #700000;
}

/* Responsive Virtual Keyboard */
@media (max-width: 768px) {
    .vk-container {
        padding: 1rem;
    }
    
    .vk-key {
        min-width: 35px;
        height: 40px;
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .vk-space {
        min-width: 200px;
    }
    
    .vk-enter {
        min-width: 100px;
    }
}
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

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

/* Responsive */
@media (max-width: 768px) {
    .visitor-selection {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .wine-detail {
        grid-template-columns: 1fr;
    }
    
    .wine-specs {
        grid-template-columns: 1fr;
    }
    
    .logo-header h1 {
        font-size: 2rem;
    }
}