/* Consignas Widget Styles */

.consignas-widget {
    margin-bottom: 2rem;
    width: 100%;
}

.consignas-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.consigna-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.consigna-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.consigna-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.consigna-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.consigna-content {
    padding: 1.5rem;
}

.consigna-badge {
    display: inline-block;
    background: linear-gradient(135deg, #EF4A3E 0%, #d43d2f 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.consigna-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.consigna-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Options (radio buttons) */
.consigna-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.consigna-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.consigna-option:hover {
    background: #ebebeb;
}

.consigna-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #EF4A3E;
    cursor: pointer;
}

.consigna-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #EF4A3E;
}

.consigna-option:has(input:checked) {
    background: #fff5f4;
    border-color: #EF4A3E;
}

.consigna-option span {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

/* Textarea for questions */
.consigna-textarea textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.consigna-textarea textarea:focus {
    outline: none;
    border-color: #EF4A3E;
}

.consigna-textarea textarea::placeholder {
    color: #999;
}

/* Input fields */
.consigna-fields {
    display: flex;
    gap: 0.75rem;
}

.consigna-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.consigna-input:focus {
    outline: none;
    border-color: #EF4A3E;
}

.consigna-input::placeholder {
    color: #999;
}

.consigna-input-small {
    flex: 0 0 120px;
    text-align: center;
}

/* Submit button */
.consigna-submit {
    background: linear-gradient(135deg, #EF4A3E 0%, #d43d2f 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.consigna-submit:hover {
    background: linear-gradient(135deg, #d43d2f 0%, #c0352a 100%);
    transform: translateY(-2px);
}

.consigna-submit:active {
    transform: translateY(0);
}

.consigna-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.consigna-submit .spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Success state */
.consigna-success {
    text-align: center;
    padding: 1rem;
}

.consigna-success-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: scaleIn 0.3s ease;
}

.consigna-success-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

.consigna-success-text {
    font-size: 1rem;
    color: #333;
    margin: 0;
}

.consigna-success-text.correct {
    color: #4CAF50;
    font-weight: 600;
}

.consigna-success-text.incorrect {
    color: #ff9800;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Already participated state */
.consigna-card.participated .consigna-form {
    display: none;
}

.consigna-card.participated .consigna-success {
    display: block !important;
}

/* Responsive */
@media (max-width: 768px) {
    .consignas-container {
        flex-direction: column;
        align-items: center;
    }

    .consigna-card {
        max-width: 100%;
    }

    .consigna-fields {
        flex-direction: column;
    }

    .consigna-input-small {
        flex: 1;
    }

    .consigna-image {
        height: 150px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .consigna-card {
        background: linear-gradient(145deg, #2a2a2a 0%, #1f1f1f 100%);
    }

    .consigna-title {
        color: #f0f0f0;
    }

    .consigna-option {
        background: #333;
    }

    .consigna-option:hover {
        background: #3a3a3a;
    }

    .consigna-option span {
        color: #e0e0e0;
    }

    .consigna-textarea textarea,
    .consigna-input {
        background: #333;
        border-color: #444;
        color: #e0e0e0;
    }

    .consigna-success-text {
        color: #e0e0e0;
    }
}
