/* Telegram-style questionnaire styling */
:root {
    --tg-btn-bg: #f0f2f5;
    --tg-btn-hover: #e4e6e8;
    --tg-btn-active: #d5d7d9;
    --tg-btn-text: #000000;
    --success-color: #4CAF50;
    --spinner-color: #40a7e3;
}

[data-theme="dark"] {
    --tg-btn-bg: #2C3847;
    --tg-btn-hover: #36424F;
    --tg-btn-active: #3A4755;
    --tg-btn-text: #ffffff;
}

.questionnaire-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 30px;
}

#question-container, #result-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

#result-container {
    display: none;
}

.question-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-color);
}

.button-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
}

/* Telegram-style buttons */
.tg-button {
    background-color: var(--tg-btn-bg);
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--tg-btn-text);
    text-align: left;
    outline: none;
    position: relative;
    overflow: hidden;
}

.tg-button:hover {
    background-color: var(--tg-btn-hover);
}

.tg-button:active {
    background-color: var(--tg-btn-active);
    transform: translateY(1px);
}

/* Button ripple effect */
.tg-button::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.5s, opacity 0.5s;
}

.tg-button:active::after {
    transform: scale(4);
    opacity: 0;
    transition: 0s;
}

/* Selected state */
.tg-button.selected {
    background-color: var(--button-bg);
    color: white;
}

/* Emoji and text positioning */
.emoji {
    font-size: 20px;
    margin-right: 14px;
}

.button-text {
    flex-grow: 1;
}

/* Loading animation */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--spinner-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Result styling */
.result-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
    text-align: center;
}

.success-icon {
    width: 60px;
    height: 60px;
    background-color: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 15px;
}

.result-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-color);
    text-align: center;
}

.result-description {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 10px;
}

/* Button animations */
.telegram-button.animated {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease-out forwards;
    /* Ensure button stays visible */
    animation-fill-mode: forwards;
    display: inline-block;
    margin: 0 auto;
    text-align: center;
    width: auto;
    max-width: 80%;
}

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

.telegram-button.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .button-container {
        gap: 10px;
    }
    
    .tg-button {
        padding: 10px 16px;
        font-size: 15px;
    }
    
    .emoji {
        font-size: 18px;
        margin-right: 12px;
    }
}
