/* Custom Styles - Updated Color Scheme */
:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --gradient-danger: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header Styles */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Post Card Styles */
.post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.post-image {
    height: 100px;
    object-fit: cover;
}

.post-meta {
    font-size: 0.9rem;
    color: #6c757d;
}

.post-meta i {
    margin-right: 5px;
}

/* Sidebar Styles */
.sidebar {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.sidebar h5 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    padding: 5px 0;
    border-bottom: 1px solid #dee2e6;
}

.sidebar ul li:last-child {
    border-bottom: none;
}

.sidebar ul li a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.sidebar ul li a:hover {
    color: var(--primary-color);
}

/* Comment Styles */
.comment {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.comment-author {
    font-weight: bold;
    color: var(--primary-color);
}

.comment-date {
    font-size: 0.8rem;
    color: #6c757d;
}

.comment-content {
    margin-top: 10px;
}

/* Admin Panel Styles */
.admin-sidebar {
    background-color: var(--dark-color);
    min-height: 100vh;
    padding: 20px 0;
}

.admin-sidebar .nav-link {
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    margin: 5px 10px;
    transition: background-color 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
}

.admin-sidebar .nav-link i {
    margin-right: 10px;
}

/* Dashboard Cards */
.dashboard-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.dashboard-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.dashboard-card p {
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-link:hover {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Quill Editor Styling */
#quill-editor {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
}

.ql-toolbar {
    border-top: 2px solid #e9ecef !important;
    border-left: 2px solid #e9ecef !important;
    border-right: 2px solid #e9ecef !important;
    border-bottom: 1px solid #e9ecef !important;
    border-radius: 8px 8px 0 0 !important;
    background: #f8f9fa;
}

.ql-container {
    border-left: 2px solid #e9ecef !important;
    border-right: 2px solid #e9ecef !important;
    border-bottom: 2px solid #e9ecef !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ql-editor {
    font-size: 14px;
    line-height: 1.6;
    min-height: 350px;
}

.ql-toolbar .ql-stroke {
    stroke: var(--primary-color);
}

.ql-toolbar .ql-fill {
    fill: var(--primary-color);
}

.ql-toolbar button:hover {
    background: var(--primary-color);
    color: white;
}

.ql-toolbar button.ql-active {
    background: var(--primary-color);
    color: white;
}

/* Quill Editor Image Styles */
.ql-editor img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 15px auto;
    display: block;
}

/* Enhanced Image Controls */
.image-controls {
    margin: 15px 0 !important;
    background: #f8f9fa !important;
    padding: 15px !important;
    border-radius: 8px !important;
    border: 2px solid #dee2e6 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    text-align: left !important;
}

.image-control-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-section label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.size-buttons,
.align-buttons,
.action-buttons,
.crop-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.size-buttons button,
.align-buttons button,
.action-buttons button,
.crop-controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.size-buttons button:hover,
.align-buttons button:hover,
.action-buttons button:hover,
.crop-controls button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.align-buttons button.active {
    background: var(--success-color);
}

.action-buttons button.danger {
    background: var(--danger-color);
}

.action-buttons button.danger:hover {
    background: #c82333;
}

.crop-controls button {
    background: var(--info-color);
}

.crop-controls button:hover {
    background: #138496;
}

.custom-width {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.custom-width input[type="range"] {
    flex: 1;
    max-width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.custom-width input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.custom-width input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.custom-width span {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 50px;
    text-align: center;
}

/* Image Caption Styles */
.image-caption {
    text-align: center !important;
    font-style: italic !important;
    font-size: 14px !important;
    color: #666 !important;
    margin: 5px auto 15px auto !important;
    padding: 5px !important;
    background: #f8f9fa !important;
    border-radius: 4px !important;
    max-width: 80% !important;
}

/* Image Upload Crop Modal */
.image-crop-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.9) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 10000 !important;
}

.image-crop-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 95%;
    max-height: 95%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.crop-modal-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crop-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.crop-modal-body {
    padding: 20px;
    display: flex;
    gap: 20px;
    overflow-y: auto;
    max-height: 70vh;
}

.image-preview-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 300px;
}

.original-preview,
.crop-preview {
    text-align: center;
}

.original-preview h4,
.crop-preview h4 {
    margin: 0 0 10px 0;
    color: var(--dark-color);
    font-size: 16px;
}

.crop-controls-section {
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crop-settings,
.resize-settings {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.crop-settings h4,
.resize-settings h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.crop-inputs,
.resize-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: 600;
    font-size: 12px;
    color: var(--dark-color);
}

.input-group input[type="number"] {
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.input-group input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.preset-crops {
    margin-top: 15px;
}

.preset-crops h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--dark-color);
}

.preset-crops button {
    background: var(--info-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 2px;
    transition: background-color 0.3s ease;
}

.preset-crops button:hover {
    background: #138496;
}

.preset-crops button.active {
    background: var(--success-color);
    color: white;
}

.preset-crops button.active:hover {
    background: #218838;
}

.quality-settings {
    margin-top: 15px;
}

.quality-settings label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.quality-settings input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.quality-settings span {
    font-weight: 600;
    color: var(--primary-color);
}

.crop-modal-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #dee2e6;
}

.crop-modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-cancel {
    background: var(--danger-color);
    color: white;
}

.btn-cancel:hover {
    background: #c82333;
}

/* Canvas styling */
#cropPreviewCanvas {
    border: 2px solid var(--primary-color) !important;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#originalImage {
    border: 2px solid #dee2e6 !important;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Checkbox styling */
.input-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .post-image {
        height: 150px;
    }

    .sidebar {
        margin-top: 20px;
    }

    .dashboard-card h3 {
        font-size: 2rem;
    }

    .ql-toolbar {
        padding: 8px;
    }

    .ql-editor {
        min-height: 250px;
        font-size: 16px;
    }

    .ql-editor img {
        max-width: 95% !important;
        margin: 10px auto !important;
    }

    .image-control-panel {
        gap: 10px;
    }

    .size-buttons,
    .align-buttons,
    .action-buttons,
    .crop-controls {
        flex-direction: column;
        align-items: center;
    }

    .size-buttons button,
    .align-buttons button,
    .action-buttons button,
    .crop-controls button {
        width: 100%;
        max-width: 200px;
    }

    .custom-width {
        flex-direction: column;
        gap: 5px;
    }

    .custom-width input[type="range"] {
        max-width: 100%;
    }

    .image-crop-modal-content {
        max-width: 98%;
        max-height: 98%;
    }

    .crop-modal-body {
        flex-direction: column;
        padding: 15px;
    }

    .image-preview-section {
        min-width: auto;
    }

    .crop-controls-section {
        min-width: auto;
    }

    .crop-inputs,
    .resize-inputs {
        grid-template-columns: 1fr;
    }

    .crop-modal-footer {
        flex-wrap: wrap;
        justify-content: center;
    }

    .crop-modal-footer button {
        flex: 1;
        min-width: 120px;
    }
}

/* Post Content Image Styling */
.post-content img,
.post-image {
    max-width: 85% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 25px auto !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    border: none !important;
}

/* Featured Image Styling - 16:9 Aspect Ratio */
.featured-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio (9/16 = 0.5625) */
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 2rem;
}

.featured-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Fallback for old featured images without container */
.post .img-fluid {
    max-width: 90% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto 2rem auto !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Post Content Container */
.post-content {
    line-height: 1.8;
    font-size: 16px;
    color: #333;
    padding: 0 15px;
}

.post-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

/* Mobile Responsive Post Images */
@media (max-width: 768px) {
    .post-content img {
        max-width: 95% !important;
        margin: 15px auto !important;
    }

    .featured-image-container {
        border-radius: 8px;
        margin-bottom: 1.5rem;
    }

    .post .img-fluid {
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
    }

    .post-content {
        padding: 0 10px;
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .post-content img {
        max-width: 100% !important;
        margin: 10px auto !important;
    }

    .post-content {
        padding: 0 5px;
        font-size: 14px;
    }
}

/* L
ike/Dislike Buttons Styling */
.post-reactions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.reaction-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-like,
.btn-dislike {
    background: white;
    border: 2px solid #dee2e6;
    color: #6c757d;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    justify-content: center;
}

.btn-like:hover {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-dislike:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-like.active {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-dislike.active {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-like i,
.btn-dislike i {
    font-size: 16px;
}

.like-count,
.dislike-count {
    font-size: 14px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.reaction-stats {
    font-style: italic;
}

/* Loading state for buttons */
.btn-like.loading,
.btn-dislike.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-like.loading::after,
.btn-dislike.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 5px;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .post-reactions {
        padding: 15px;
    }

    .reaction-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .btn-like,
    .btn-dislike {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .d-flex.align-items-center.justify-content-between {
        flex-direction: column;
        gap: 15px;
    }

    .reaction-stats {
        text-align: center;
    }

    .foowi{
        width: 100%;
    }
}
/* SEO-friendly breadcrumbs */
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* SEO-friendly heading structure */
article h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

article h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

article h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Mobile SEO optimizations */
@media (max-width: 576px) {
    article h1 {
        font-size: 2rem;
    }
    
    article h2 {
        font-size: 1.5rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
}