/* Custom CSS for Project Dard */

/* Root Variables */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-color: #495057;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #ffffff !important;
    line-height: 1.6;
}

/* Persian Font Support */
body[dir="rtl"], 
.fa-text,
[dir="rtl"] {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Dark Theme Overrides */
.bg-dark {
    background-color: #1a1a1a !important;
}

.bg-secondary {
    background-color: #2d3748 !important;
}

.text-light {
    color: #ffffff !important;
}

.border-secondary {
    border-color: #4a5568 !important;
}

/* Force white text for all content */
h1, h2, h3, h4, h5, h6, p, span, div, a, label, small, strong, li, td, th {
    color: #ffffff !important;
}

/* Links */
a {
    color: #ffffff !important;
    text-decoration: none;
}

a:hover {
    color: #007bff !important;
    text-decoration: underline;
}

/* Specific overrides for muted text */
.text-muted {
    color: #c7c7c7 !important;
}

/* Card text */
.card-title, .card-text, .card-body {
    color: #ffffff !important;
}

/* Footer text */
footer, footer * {
    color: #ffffff !important;
}

/* Social links */
.social-links a {
    color: #ffffff !important;
}

.social-links a:hover {
    color: #ffffff !important;
}

/* Navigation */
.navbar {
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #ffffff !important;
}

.navbar-nav .nav-link {
    color: #ffffff !important;
}

.navbar-nav .nav-link:hover {
    color: #007bff !important;
}

.dropdown-menu {
    background-color: #2d3748 !important;
}

.dropdown-item {
    color: #ffffff !important;
}

.dropdown-item:hover {
    background-color: #007bff !important;
    color: #ffffff !important;
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Forms */
.form-control, .form-select {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #ffffff !important;
}

.form-control:focus,
.form-select:focus {
    background-color: #2d3748 !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control::placeholder {
    color: #a0aec0 !important;
}

.form-label {
    color: #ffffff !important;
}

.form-text {
    color: #c7c7c7 !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    color: #ffffff !important;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-danger,
.btn-outline-info {
    color: #ffffff !important;
    border-color: currentColor !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover,
.btn-outline-info:hover {
    color: #ffffff !important;
}

/* Specific button styles */
.btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #ffffff !important;
}

.btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}

.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

/* Comments */
.comment-item {
    transition: background-color 0.2s ease-in-out;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.comment-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.comment-content {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin: 0.5rem 0;
}

.comment-content[dir="rtl"] {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

.vote-btn {
    min-width: 70px;
    transition: all 0.2s ease-in-out;
}

.vote-btn:hover {
    transform: scale(1.05);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

/* Language Switcher */
.language-switcher {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.25rem;
}

.language-switcher .btn {
    border-radius: 16px;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

/* Profile Images */
.profile-image-placeholder {
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease-in-out;
}

.profile-image-placeholder:hover {
    transform: scale(1.05);
}

/* Statistics Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-danger,
.card.bg-info {
    border: none;
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-warning:hover,
.card.bg-danger:hover,
.card.bg-info:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    color: #ffffff !important;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.3);
    color: #ffffff !important;
    border-left: 4px solid #17a2b8;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.3);
    color: #ffffff !important;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.3);
    color: #ffffff !important;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.3);
    color: #000000 !important;
    border-left: 4px solid #ffc107;
}

/* Badges */
.badge {
    color: #ffffff !important;
}

.badge.bg-primary {
    background-color: #007bff !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

/* Pagination */
.pagination .page-link {
    background-color: #2d3748 !important;
    border-color: var(--border-color) !important;
    color: #ffffff !important;
}

.pagination .page-link:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease-in-out;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    text-decoration: none;
    color: #ffffff;
}

/* Admin Dashboard */
.comment-admin-item {
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: background-color 0.2s ease-in-out;
}

.comment-admin-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-group-vertical {
        width: 100%;
    }
    
    .comment-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .vote-btn {
        flex: 1;
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2d3748;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .pagination,
    footer {
        display: none !important;
    }
    
    .container {
        width: 100% !important;
        max-width: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
