/* Responsive Design İyileştirmeleri */

/* Mobile First Approach */
:root {
    --mobile-padding: 1rem;
    --tablet-padding: 1.5rem;
    --desktop-padding: 2rem;
}

/* Base Mobile Styles */
.container {
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
}

/* Navigation Improvements */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .profile-button {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 0;
    }
    
    .profile-info {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .updates-box {
        display: none !important;
    }
    
    .search-box {
        margin-bottom: 1rem !important;
    }
    
    .search-box .card-body {
        padding: 0.5rem !important;
    }
    
    .search-box .form-control {
        font-size: 0.875rem !important;
        padding: 0.375rem 0.75rem !important;
        height: 32px !important;
    }
    
    .search-box .btn {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.875rem !important;
        height: 32px !important;
    }
}

/* Topic Cards Mobile */
@media (max-width: 768px) {
    .topic-card {
        margin-bottom: 1rem;
    }
    
    .topic-card .card-body {
        padding: 1rem;
    }
    
    .topic-card .card-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .topic-badges {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.25em 0.5em;
    }
    
    .topic-stats {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .topic-stats span {
        font-size: 0.75rem;
        padding: 0.125rem 0.5rem;
    }
}

/* Category Sidebar Mobile */
@media (max-width: 768px) {
    .category-sidebar {
        margin-bottom: 2rem;
    }
    
    .category-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .category-link .badge {
        display: none;
    }
    
    .category-link .fa-chevron-right {
        display: none;
    }
}

/* Forms Mobile */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
}

/* Tables Mobile */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    /* Hide less important columns on mobile */
    .table .d-none-mobile {
        display: none !important;
    }
}

/* Modal Mobile */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}

/* Comments Mobile */
@media (max-width: 768px) {
    .comment-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .comment-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }
    
    .comment-meta {
        font-size: 0.8rem;
    }
    
    .comment-actions {
        margin-top: 0 !important;
        display: flex !important;
        gap: 0.25rem !important;
        position: relative !important;
        right: 0 !important;
        top: 0 !important;
    }
    
    .comment-actions .btn {
        padding: 0.15rem 0.35rem !important;
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
        min-width: auto !important;
        height: auto !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .comment-actions .btn i {
        font-size: 0.8rem !important;
        margin: 0 !important;
    }

    .comment-actions form {
        display: inline !important;
    }

    /* Messages page mobile layout */
    .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 1rem !important;
    }

    .col-md-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* Image Gallery Mobile */
@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .image-preview {
        margin-bottom: 0.5rem;
    }
    
    .image-preview img {
        height: 150px;
    }
    
    .delete-image {
        width: 25px;
        height: 25px;
        top: 5px;
        right: 5px;
    }
}

/* Notification Dropdown Mobile */
@media (max-width: 768px) {
    .notification-dropdown .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
    }
    
    .notifications-list {
        max-height: 300px;
    }
    
    .notification-item {
        padding: 1rem;
    }
    
    .notification-text {
        font-size: 0.9rem;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding-left: var(--tablet-padding);
        padding-right: var(--tablet-padding);
    }
    
    .topic-card .card-title {
        font-size: 1.2rem;
    }
    
    .category-link {
        padding: 1rem;
    }
}

/* Desktop Styles */
@media (min-width: 1025px) {
    .container {
        padding-left: var(--desktop-padding);
        padding-right: var(--desktop-padding);
    }
    
    .topic-card {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
    }
    
    .topic-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
        border-color: rgba(52, 152, 219, 0.5) !important;
    }
    
    [data-bs-theme="dark"] .topic-card:hover {
        border-color: rgba(116, 192, 252, 0.6) !important;
    }
    
    .topic-card:hover .card-title a {
        color: #3498db !important;
    }
    
    .topic-card:hover .profile-icon-wrapper {
        transform: scale(1.05);
    }
    
    .topic-card:hover .topic-footer span {
        color: #495057 !important;
    }
    
    .topic-card .favorite-badge:hover {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    
    .category-link:hover .fa-chevron-right {
        transform: translateX(3px);
    }
    
    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

/* Ek topic-card stilleri */
.topic-card {
    /* Sadece hover efektleri için transition */
    border: 1px solid rgba(0,0,0,0.08) !important;
    transition: border-color 0.3s ease;
}

.topic-card:hover {
    border-color: rgba(52, 152, 219, 0.3) !important;
}

.topic-card .card-body {
    transition: none;
}

.topic-card .card-title,
.topic-card .card-title a {
    transition: none;
}

.topic-card .card-text {
    transition: none;
}

.topic-card .username {
    transition: none;
}

.topic-card .topic-footer span {
    transition: none;
}

.topic-card .profile-icon-wrapper {
    transition: transform 0.3s ease;
}

.topic-card .badge {
    transition: all 0.3s ease;
}

.topic-card .favorite-badge {
    transition: all 0.3s ease;
}

.topic-card .favorite-badge:not(.text-white):hover {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    color: white !important;
    transform: scale(1.05);
}

/* Ayırıcı çizgi iyileştirmeleri - Gündüz Modu */
.topic-card .topic-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.15) 50%, transparent 100%);
    margin: 0.5rem 0 1rem 0;
}

.topic-card .topic-divider-bottom {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.15) 50%, transparent 100%);
    margin: 1rem 0 0.5rem 0;
}

/* Karanlık Mod İyileştirmeleri */
[data-bs-theme="dark"] .topic-card {
    border: 1px solid rgba(255,255,255,0.1) !important;
}

[data-bs-theme="dark"] .topic-card:hover {
    border-color: rgba(116, 192, 252, 0.4) !important;
}

[data-bs-theme="dark"] .topic-card .card-title {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .topic-card .card-title a {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .topic-card .card-text {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .topic-card .username {
    /* Profil rengini korumak için inherit yerine auto kullan */
}

[data-bs-theme="dark"] .topic-card .profile-icon-wrapper {
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
}

[data-bs-theme="dark"] .topic-card .topic-divider {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
}

[data-bs-theme="dark"] .topic-card .topic-divider-bottom {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
}

[data-bs-theme="dark"] .topic-card:hover .card-title a {
    color: #74c0fc !important;
}

[data-bs-theme="dark"] .topic-card:hover .topic-footer span {
    color: #ced4da !important;
}

/* Profil çerçevesi cam efekti iyileştirmeleri */
.topic-card .profile-icon-wrapper {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.topic-card .profile-icon-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 12px;
    pointer-events: none;
}

[data-bs-theme="dark"] .topic-card .profile-icon-wrapper::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}

/* Responsive iyileştirmeler */
@media (max-width: 768px) {
    .topic-card {
        border-radius: 8px !important;
    }
    
    .topic-card .card-body {
        padding: 1rem !important;
    }
    
    .topic-card .profile-icon-wrapper img {
        width: 32px !important;
        height: 32px !important;
    }
    
    .topic-card .badge {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.5rem !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    .btn,
    .dropdown,
    .modal,
    .notification-dropdown {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
    
    .topic-card,
    .comment-item {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        margin-bottom: 1rem;
    }
    
    a {
        text-decoration: none !important;
        color: inherit !important;
    }
    
    .topic-content,
    .comment-content {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .user-avatar,
    .profile-avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Improvements */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #1a1a1a;
        --bs-body-color: #ffffff;
        --bs-border-color: #333333;
    }
}

/* Badge Improvements for Light Mode */
.badge.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: white !important;
}

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

.badge.bg-success {
    background-color: #198754 !important;
    color: white !important;
}

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

.badge.favorite-badge {
    background-color: #ffc107 !important;
    color: #000 !important;
    border: none !important;
    padding: 0.35rem 0.65rem !important;
}

.badge.favorite-badge.text-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
    color: #ffc107 !important;
}

/* Dark Mode Badge Adjustments */
[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: #495057 !important;
    color: white !important;
}

[data-bs-theme="dark"] .badge.favorite-badge.text-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #ffc107 !important;
}

/* Focus Improvements for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.category-link:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sticky-top-mobile {
    position: sticky;
    top: 0;
    z-index: 1020;
}

@media (min-width: 768px) {
    .sticky-top-mobile {
        position: static;
    }
} 