/* Enhanced Features CSS for NCERT Solutions Question Page */

/* Common Styles */
.voting-section {
    margin: 20px 10px;
    padding-top: 15px;
    padding-bottom: 1px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #111;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    margin: 0 5px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
}

.vote-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    text-decoration: none;
    color: #495057;
}

.vote-btn.voted-up {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.vote-btn.voted-down {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.vote-count-up,
.vote-count-down {
    font-weight: bold;
    margin-right: 5px;
}

/* User Answer Form */
.user-answer-form {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.user-answer-form h4 {
    color: #495057;
    margin-bottom: 20px;
}

.single-form {
    margin-bottom: 15px;
}

.single-form input,
.single-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.single-form input:focus,
.single-form textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.single-form button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.single-form button[type="button"]:first-of-type {
    background: #007bff;
    color: white;
}

.single-form button[type="button"]:first-of-type:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d !important;
    color: white !important;
}

.btn-secondary:hover {
    background: #545b62 !important;
}

/* User Answers Section */
.user-answers-section {
    margin: 30px 0;
}

.user-answer-item {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.answer-date {
    color: #6c757d;
    font-size: 12px;
}

.answer-content {
    line-height: 1.6;
    color: #495057;
}

.answer-voting {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* Issue Report Modal */
.modal-content {
    border-radius: 8px;
}

.modal-body h4 {
    color: #495057;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Enhanced Comment Section */
.comment-item {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.comment-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
}

.reply-form {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px;
}

.replies-section {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px;
}

.reply-item {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    margin-left: 20px;
}

/* Alert Messages */
.alert-q {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .voting-section .meta {
        display: table-row-group;
        flex-direction: column;
        gap: 10px;
    }
    
    .voting-section .meta li {
        flex: 1;
    }
    
    .vote-btn {
        display: block;
        text-align: center;
        width: 100%;
        margin: 5px 0;
    }
    
    .user-answer-form {
        padding: 15px;
    }
    
    .user-answer-item {
        padding: 15px;
    }
    
    .answer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .comment-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .reply-form {
        padding: 15px;
    }
    
    .replies-section {
        padding: 15px;
    }
    
    .reply-item {
        margin-left: 10px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .voting-section {
        padding: 10px;
    }
    
    .vote-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .user-answer-form,
    .user-answer-item {
        padding: 10px;
    }
    
    .single-form input,
    .single-form textarea {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .single-form button {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px;
    }
    
    .comment-actions {
        justify-content: space-between;
    }
    
    .vote-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error States */
.vote-success {
    animation: pulse 0.5s ease-in-out;
}

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


/* Print Styles */
@media print {
    .voting-section,
    .user-answer-form,
    .comment-actions,
    .reply-form {
        display: none;
    }
    
    .user-answer-item,
    .comment-item {
        border: 1px solid #000;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
}
