/* WERSJA 1.1: GRID 2x2 LAYOUT - Mobile First Design */

* {
    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: #1e3a8a;
    background: linear-gradient(135deg, #0ea5e9 0%, #1e40af 50%, #1e3a8a 100%);
    min-height: 100vh;
    font-size: 16px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
}

/* System stron */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in;
    min-height: calc(100vh - 30px);
}

.page.active {
    display: flex;
    flex-direction: column;
}

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

header {
    text-align: center;
    margin-bottom: 25px;
    color: white;
    padding-top: 20px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 800;
}

header p {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 500;
}

main {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
}

/* Sekcje */
.welcome-section, .voting-section, .results-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 100%;
}

/* Strona powitalna */
.welcome-content {
    text-align: center;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
}

.welcome-content h2 {
    color: #1e3a8a;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
}

.info-box {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #0ea5e9;
    border: 2px solid #0ea5e9;
}

.info-box p {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #1e3a8a;
    font-weight: 500;
}

.features {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #1e3a8a;
    font-weight: 500;
}

.feature .icon {
    font-size: 1.3rem;
    min-width: 28px;
}

/* Przyciski */
.primary-btn {
    width: 100%;
    padding: 18px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #0ea5e9 0%, #1e40af 50%, #1e3a8a 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    margin-top: 20px;
}

.primary-btn:hover, .primary-btn:focus {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(14, 165, 233, 0.5);
}

.primary-btn:active {
    transform: translateY(-1px);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Strona głosowania */
.voting-section h2, .results-section h2 {
    margin-bottom: 25px;
    color: #1e3a8a;
    font-size: 1.4rem;
    text-align: center;
    font-weight: 700;
}

.options {
    margin-bottom: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option {
    border-radius: 20px;
    border: 3px solid #e0f2fe;
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

.option:hover {
    border-color: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.15);
}

.option input[type="radio"] {
    display: none;
}

.option label {
    display: flex;
    flex-direction: column;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.option input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #0ea5e9 0%, #1e40af 100%);
    color: white;
}

.option input[type="radio"]:checked + label .name,
.option input[type="radio"]:checked + label .meaning {
    color: white;
}

/* Avatar container */
.avatar-container {
    margin-bottom: 15px;
}

/* SVG Avatary */
.avatar-svg {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    display: block;
    transition: transform 0.3s ease;
}

.option:hover .avatar-svg {
    transform: scale(1.08);
}

/* Animacja uśmiechu */
.mouth-normal {
    transition: all 0.3s ease;
}

.mouth-smile {
    opacity: 0;
    transition: all 0.3s ease;
}

.option:hover .mouth-normal {
    opacity: 0;
}

.option:hover .mouth-smile {
    opacity: 1;
}

/* Animacja oczu */
.eyes-normal {
    transition: all 0.3s ease;
}

.eyes-happy {
    opacity: 0;
    transition: all 0.3s ease;
}

.option:hover .eyes-normal {
    opacity: 0;
}

.option:hover .eyes-happy {
    opacity: 1;
}

/* Teksty w opcjach */
.option label .name {
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 2px;
    display: block;
}

.option label .meaning {
    font-size: 0.75rem;
    color: #0ea5e9;
    font-style: italic;
    font-weight: 500;
    display: block;
}

/* Wiadomości */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
}

.message.success {
    background-color: #dcfce7;
    color: #166534;
    border: 2px solid #22c55e;
}

.message.error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 2px solid #ef4444;
}

.message.hidden {
    display: none;
}

/* Strona wyników */
.trophy-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 15px;
}

.result-item {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 15px;
    padding: 18px;
    border: 2px solid #0ea5e9;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.option-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a8a;
}

.vote-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0ea5e9;
}

.progress-bar {
    height: 25px;
    background-color: #e0f2fe;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #0ea5e9;
}

.progress {
    height: 100%;
    background: linear-gradient(135deg, #0ea5e9 0%, #1e40af 100%);
    border-radius: 12px;
    transition: width 0.8s ease;
    width: 0%;
    position: relative;
}

.total-votes {
    margin: 25px 0;
    padding: 18px;
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    border-radius: 15px;
    font-size: 1.1rem;
    text-align: center;
    color: #1e3a8a;
    border: 2px solid #0ea5e9;
    font-weight: 700;
}

/* Kontener dla sekcji podziękowań */
.thank-you-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 100%;
    border: 2px solid #0ea5e9;
    margin-top: 20px;
}

.thank-you {
    text-align: center;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(30, 58, 138, 0.1) 100%);
    border-radius: 15px;
    border: 2px solid rgba(14, 165, 233, 0.3);
}

.thank-you h3 {
    color: #1e3a8a;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.thank-you p {
    color: #0ea5e9;
    font-size: 1rem;
    font-weight: 500;
}

.final-note {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid rgba(14, 165, 233, 0.3);
}

.final-note p {
    color: #1e3a8a;
    font-size: 0.9rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.final-note p:last-child {
    margin-bottom: 0;
}

/* Reset button - tylko lokalnie */
.dev-only {
    display: none;
}

/* Show tylko gdy hostname zawiera localhost */
body[data-env="local"] .dev-only {
    display: block;
}

/* Reset button */
.reset-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    color: #6b7280;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-top: 15px;
}

.reset-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Tablet responsiveness */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        padding: 20px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    header p {
        font-size: 1.1rem;
    }
    
    .welcome-section, .voting-section, .results-section {
        padding: 35px;
    }
    
    .hero-icon {
        font-size: 5rem;
    }
    
    .welcome-content h2 {
        font-size: 1.8rem;
    }
    
    .primary-btn {
        font-size: 1.2rem;
        padding: 20px 25px;
    }
    
    .avatar-svg {
        width: 90px;
        height: 90px;
    }
    
    .options {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .option label {
        padding: 25px;
    }
    
    .option label .name {
        font-size: 1.5rem;
    }
    
    .option label .meaning {
        font-size: 1.1rem;
    }
}

/* Desktop responsiveness */
@media (min-width: 1024px) {
    .container {
        max-width: 800px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .welcome-section, .voting-section, .results-section {
        padding: 40px;
    }
    
    .options {
        grid-template-columns: 1fr 1fr;
        max-width: 600px;
        margin: 0 auto 25px auto;
    }
}