/* ========================================
   Stream Questions - Enhanced UI/UX Styles
   ======================================== */

/* Custom Modal Styles */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.custom-modal {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-modal-content {
    padding: 0;
}

.custom-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.custom-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.custom-modal-body {
    padding: 20px;
    color: #495057;
    line-height: 1.6;
    font-size: 1rem;
}

.custom-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.custom-modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    min-width: 100px;
}

.custom-modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-modal-footer .btn:active {
    transform: translateY(0);
}

.custom-modal-footer .btn-success {
    background-color: #28a745;
    color: white;
}

.custom-modal-footer .btn-success:hover {
    background-color: #218838;
}

.custom-modal-footer .btn-danger {
    background-color: #dc3545;
    color: white;
}

.custom-modal-footer .btn-danger:hover {
    background-color: #c82333;
}

.custom-modal-footer .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.custom-modal-footer .btn-secondary:hover {
    background-color: #5a6268;
}

/* Button Loading State */
.btn-loading {
    opacity: 0.85;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-loading .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.25em;
    margin-right: 0.5rem;
}

/* Enhanced Submit Button */
#SubmitQuestion {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 180px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

#SubmitQuestion:not(.btn-loading):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

#SubmitQuestion:not(.btn-loading):active {
    transform: translateY(0);
}

#SubmitQuestion.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

#SubmitQuestion .spinner-border {
    animation: spin 0.8s linear infinite;
}

/* Spinner Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Form Elements Enhancement */
#PostQuestion {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    resize: vertical;
    min-height: 100px;
    font-size: 1rem;
}

#PostQuestion:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    border-color: #28a745;
}

#AgendaItemId {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#AgendaItemId:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    border-color: #28a745;
}

/* Success Animation */
.success-animation {
    animation: successBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successBounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Validation Errors Enhancement */
.validation-errors {
    animation: slideDown 0.4s ease-out;
    margin-bottom: 2rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-card {
    animation: shakeError 0.3s ease-out;
}

@keyframes shakeError {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Swal2 Customization */
.swal2-popup.success-animation {
    animation: successBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus States for Keyboard Navigation */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Question List Item Animation */
#myquestions li {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #SubmitQuestion {
        min-width: 150px;
        width: 100%;
    }
    
    #PostQuestion {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 576px) {
    #SubmitQuestion {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
    }
}
