/**
 * SEFRQAYS SUGGESTION SYSTEM - PHASE 1 STYLES
 * Community-driven suggestion system with voting
 */

/* ==============================================
   PAGE HEADER ENHANCEMENTS
   ============================================== */
.page-header .header-actions {
    margin-top: 20px;
}

.page-header .header-actions .btn {
    font-size: 16px;
    padding: 12px 24px;
    border-radius: 8px;
}

/* ==============================================
   FILTERS BAR
   ============================================== */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 150px;
}

.suggestion-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6c757d;
    font-size: 14px;
}

.stat-item i {
    color: #007bff;
}

.user-status {
    color: #28a745;
}

.guest-status {
    color: #ffc107;
}

/* ==============================================
   SUGGESTION CARDS
   ============================================== */
.suggestions-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.suggestion-card {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.suggestion-card:hover {
    background-color: #f8f9fa;
}

.suggestion-card:last-child {
    border-bottom: none;
}

/* ==============================================
   VOTING SECTION
   ============================================== */
.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 20px;
    padding: 5px;
    min-width: 60px;
}

.vote-btn {
    background: none;
    border: 1px solid #dee2e6;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    margin: 2px 0;
}

.vote-btn:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.vote-btn.active.vote-up {
    background-color: #d4edda;
    border-color: #28a745;
    color: #28a745;
}

.vote-btn.active.vote-down {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #dc3545;
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vote-count {
    font-weight: 700;
    color: #495057;
    margin: 8px 0;
    font-size: 16px;
    text-align: center;
    min-width: 30px;
}

/* ==============================================
   SUGGESTION CONTENT
   ============================================== */
.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-header {
    margin-bottom: 15px;
}

.suggestion-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.suggestion-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #6c757d;
    font-size: 14px;
    flex-wrap: wrap;
}

.suggestion-meta .author {
    color: #495057;
    font-weight: 500;
}

.suggestion-meta .completions {
    color: #28a745;
    font-weight: 500;
}

.suggestion-description {
    margin-bottom: 15px;
}

.suggestion-description p {
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

.suggestion-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.vote-details {
    display: flex;
    gap: 15px;
    color: #6c757d;
    font-size: 13px;
}

.upvotes {
    color: #28a745;
}

.downvotes {
    color: #dc3545;
}

/* ==============================================
   EMPTY STATE
   ============================================== */
.no-content {
    text-align: center;
    padding: 60px 20px;
}

.empty-state {
    max-width: 400px;
    margin: 0 auto;
}

.empty-state i {
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #495057;
    margin-bottom: 15px;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ==============================================
   SIDEBAR ENHANCEMENTS
   ============================================== */
.how-it-works .step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.how-it-works .step:last-child {
    margin-bottom: 0;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    flex-shrink: 0;
}

.step-icon i {
    color: #1976d2;
    font-size: 16px;
}

.step-content h4 {
    font-size: 16px;
    color: #212529;
    margin: 0 0 5px 0;
}

.step-content p {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

.researcher-widget {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8ff 100%);
    border: 1px solid #d4edda;
}

/* ==============================================
   MODAL STYLES
   ============================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.char-count {
    text-align: left;
    margin-top: 5px;
    font-size: 13px;
    color: #6c757d;
}

.suggestion-tips {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-right: 4px solid #007bff;
}

.suggestion-tips h4 {
    color: #495057;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.suggestion-tips ul {
    margin: 0;
    padding-right: 20px;
}

.suggestion-tips li {
    color: #6c757d;
    margin-bottom: 8px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.success-message {
    text-align: center;
    padding: 40px 30px;
}

.success-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 20px;
}

.success-message h3 {
    color: #28a745;
    margin-bottom: 15px;
}

.success-message p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */
@media (max-width: 768px) {
    .suggestion-card {
        flex-direction: column;
        padding: 15px;
    }

    .vote-section {
        flex-direction: row;
        justify-content: center;
        margin: 0 0 15px 0;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 8px;
    }

    .vote-section .vote-count {
        margin: 0 15px;
        font-size: 18px;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .suggestion-stats {
        justify-content: center;
    }

    .suggestion-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .vote-details {
        justify-content: center;
    }

    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .suggestion-meta {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .vote-btn {
        width: 35px;
        height: 35px;
    }

    .suggestion-title {
        font-size: 16px;
    }

    .page-header .header-actions .btn {
        width: 100%;
    }
}

/* ==============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================== */
.vote-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.modal:focus-within .modal-content {
    outline: none;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .modal-content {
        animation: none;
    }

    .vote-btn,
    .suggestion-card {
        transition: none;
    }
}

/* ==============================================
   LOADING STATES
   ============================================== */
.vote-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.submit-loading {
    opacity: 0.8;
    pointer-events: none;
}

/* ==============================================
   DARK MODE PREPARATION (Future)
   ============================================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here in future phases */
}