/**
 * Webinar Q&A Styles
 * Sophisticated design matching Walk the Dragon aesthetic
 * OS 08-Sep-2025
 */

/* Q&A Section Base */
.webinar-qa {
    position: relative;
    background: #ffffff;
    padding: 4rem 0;
}

/* Section Header */
.qa-header {
    text-align: center;
    margin-bottom: 3rem;
}

.qa-header h2 {
    font-family: 'biennale', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #3A3532;
    text-transform: lowercase;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.qa-header p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: #666;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Form Wrapper */
.qa-form-wrapper {
    background: linear-gradient(135deg, #fbfbfb 0%, #f0ece8);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 4rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.qa-form-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Form Group */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-family: 'biennale', serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #3A3532;
    text-transform: lowercase;
    margin-bottom: 0.75rem;
    display: block;
}

/* Textarea Styling */
.qa-form textarea {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.7;
    color: #3A3532;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    width: 100%;
    resize: vertical;
    min-height: 120px;
}

.qa-form textarea:focus {
    outline: none;
    border-color: #3A3532;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(58, 53, 50, 0.05);
}

.qa-form textarea:disabled {
    background-color: #f8f9fa;
    color: #8E8C8A;
    cursor: not-allowed;
}

/* Word Count */
.word-count {
    font-family: 'manrope', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8E8C8A;
    margin-top: 0.5rem;
}

.word-count.text-red-600 {
    color: #980101 !important;
    font-weight: 600;
}

/* Message Styles */
#qa-message {
    font-family: 'manrope', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

#qa-message.bg-green-100 {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#qa-message.bg-red-100 {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Questions List Header */
.qa-questions-list h3 {
    font-family: 'biennale', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #3A3532;
    text-transform: lowercase;
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: -0.01em;
}

/* Question Item Styles */
.question-item {
    background: #ffffff;
    border: 1px solid #f0ece8;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.question-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3A3532 0%, #8E8C8A 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.question-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: #e9ecef;
}

.question-item:hover::before {
    opacity: 1;
}

.question-item.own-question {
    background: linear-gradient(135deg, #fbfbfb 0%, #f0ece8);
    border-color: #e9ecef;
}

/* Question Header */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

/* Question Meta */
.question-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.question-meta > span:first-child {
    font-family: 'biennale', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #3A3532;
    text-transform: lowercase;
    letter-spacing: -0.01em;
}

.question-meta > span:last-child {
    font-family: 'manrope', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #BBB8B6;
    margin-left: 0;
}

/* Vote Button Styles */
.vote-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    font-family: 'manrope', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.vote-button:hover:not([disabled]) {
    background-color: #3A3532;
    border-color: #3A3532;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 53, 50, 0.2);
}

.vote-button:hover:not([disabled]) .vote-count {
    color: #ffffff;
}

.vote-button:hover:not([disabled]) svg path {
    stroke: #ffffff;
}

.vote-button.voted {
    background-color: #3A3532;
    border-color: #3A3532;
    color: #ffffff;
}

.vote-button.voted .vote-count {
    color: #ffffff;
}

.vote-button.voted svg path {
    fill: #ffffff;
    stroke: #ffffff;
}

.vote-button[disabled] {
    cursor: not-allowed;
    opacity: 0.4;
    background-color: #f8f9fa;
}

.vote-button svg {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

.vote-count {
    font-weight: 600;
    color: #3A3532;
    transition: color 0.3s ease;
}

/* Fledgling Vote Display */
.vote-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    font-family: 'manrope', sans-serif;
    font-size: 0.9rem;
}

.vote-display svg {
    width: 18px;
    height: 18px;
}

.vote-display .vote-count {
    font-weight: 600;
    color: #8E8C8A;
}

/* Question Text */
.question-text p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.75;
    color: #3A3532;
    margin: 0;
    letter-spacing: 0.01em;
}

/* Own Question Badge */
.own-question-badge {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0ece8;
}

.own-question-badge span {
    font-family: 'manrope', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8E8C8A;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.own-question-badge span::before {
    content: '✓';
    color: #3A3532;
    font-weight: 600;
}

/* Black Button for Q&A - Override global styles completely */
.webinar-qa .black-button,
.webinar-qa button.black-button,
.webinar-qa a.black-button,
.qa-form button.black-button,
.qa-form button[type="submit"].black-button {
    background-color: #3A3532 !important;
    color: #ffffff !important;
    padding: 0.875rem 2.5rem !important;
    border-radius: 30px !important;
    font-family: 'manrope', sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    border: 2px solid #3A3532 !important;
    display: inline-block !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    height: auto !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.webinar-qa .black-button span,
.webinar-qa button.black-button span {
    position: relative;
    z-index: 1;
    color: #ffffff !important;
}

.webinar-qa .black-button:hover,
.webinar-qa button.black-button:hover,
.webinar-qa a.black-button:hover,
.qa-form button.black-button:hover,
.qa-form button[type="submit"].black-button:hover {
    background-color: #980101 !important;
    color: #ffffff !important;
    border-color: #980101 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(152, 1, 1, 0.3) !important;
}

.webinar-qa .black-button:hover span,
.webinar-qa button.black-button:hover span {
    color: #ffffff !important;
}

.webinar-qa .black-button:active,
.webinar-qa button.black-button:active {
    transform: translateY(-1px) !important;
}

.webinar-qa .black-button:disabled,
.webinar-qa button.black-button:disabled,
.qa-form button.black-button:disabled {
    background-color: #8E8C8A !important;
    border-color: #8E8C8A !important;
    color: #ffffff !important;
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.webinar-qa .black-button:disabled span,
.webinar-qa button.black-button:disabled span {
    color: #ffffff !important;
}

/* No Questions State */
.no-questions {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
}

.no-questions p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: #8E8C8A;
    font-style: italic;
    margin: 0;
}

/* Login Prompt Section */
.webinar-qa-login {
    padding: 5rem 0;
    background: #ffffff;
}

.webinar-qa-login h2 {
    font-family: 'biennale', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #3A3532;
    text-transform: lowercase;
    margin-bottom: 1rem;
}

.webinar-qa-login p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Notice Styles */
.qa-notice {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.qa-notice p {
    font-family: 'manrope', sans-serif;
    font-size: 0.95rem;
    color: #8E8C8A;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .webinar-qa {
        padding: 3rem 0;
    }
    
    .qa-header h2 {
        font-size: 2rem;
    }
    
    .qa-header p {
        font-size: 1rem;
    }
    
    .qa-form-wrapper {
        padding: 2rem 1.5rem;
        margin-bottom: 3rem;
    }
    
    .question-item {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .question-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .vote-button,
    .vote-display {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    
    .vote-button svg,
    .vote-display svg {
        width: 16px;
        height: 16px;
    }
    
    .question-meta > span:first-child {
        font-size: 1.05rem;
    }
    
    .question-text p {
        font-size: 0.95rem;
    }
    
    .webinar-qa .black-button {
        padding: 0.75rem 2rem;
        font-size: 0.85rem;
    }
    
    .webinar-qa-login h2 {
        font-size: 2rem;
    }
    
    .no-questions {
        padding: 3rem 1.5rem;
    }
}

/* Loading States */
.qa-loading {
    position: relative;
    pointer-events: none;
}

.qa-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #3A3532;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

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

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

.question-item {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.question-item:nth-child(1) { animation-delay: 0.1s; }
.question-item:nth-child(2) { animation-delay: 0.2s; }
.question-item:nth-child(3) { animation-delay: 0.3s; }
.question-item:nth-child(4) { animation-delay: 0.4s; }
.question-item:nth-child(5) { animation-delay: 0.5s; }

/* Vote Button Loading State */
.vote-button.loading {
    position: relative;
    color: transparent;
}

.vote-button.loading .vote-count {
    color: transparent;
}

.vote-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #3A3532;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Ripple Effect */
.vote-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(58, 53, 50, 0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Focus States for Accessibility */
.vote-button:focus,
.black-button:focus,
textarea:focus {
    outline: 3px solid rgba(58, 53, 50, 0.2);
    outline-offset: 2px;
}

/* Admin Controls */
.admin-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0ece8;
}

.admin-edit-btn,
.admin-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e9ecef;
    background: #ffffff;
    border-radius: 20px;
    font-family: 'manrope', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #8E8C8A;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-edit-btn:hover,
.admin-delete-btn:hover {
    background: #3A3532;
    border-color: #3A3532;
    color: #ffffff;
}

.admin-edit-btn:hover svg path,
.admin-delete-btn:hover svg path {
    stroke: #ffffff;
}

.admin-delete-btn:hover {
    background: #980101;
    border-color: #980101;
}

/* Admin Edit Form */
.admin-edit-form {
    margin-top: 1rem;
}

.admin-edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.75;
    color: #3A3532;
    resize: vertical;
    transition: all 0.3s ease;
}

.admin-edit-textarea:focus {
    outline: none;
    border-color: #3A3532;
    box-shadow: 0 0 0 3px rgba(58, 53, 50, 0.05);
}

.admin-edit-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.admin-save-btn,
.admin-cancel-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-family: 'manrope', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.admin-save-btn {
    background: #3A3532;
    color: #ffffff;
}

.admin-save-btn:hover {
    background: #980101;
}

.admin-save-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.admin-cancel-btn {
    background: #f8f9fa;
    color: #8E8C8A;
    border: 1px solid #e9ecef;
}

.admin-cancel-btn:hover {
    background: #e9ecef;
    color: #3A3532;
}

/* Responsive adjustments for admin controls */
@media (max-width: 768px) {
    .admin-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .admin-edit-btn,
    .admin-delete-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .vote-button,
    .qa-form-wrapper,
    .webinar-qa .black-button,
    .admin-controls {
        display: none;
    }
    
    .question-item {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
    }
}
