/* Google Fonts - Nunito */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

/* Responsive CSS - PC ve Mobil için Ayrı Stiller */

/* Desktop (PC) Stilleri */
@media (min-width: 1024px) {
    .main-app {
        height: 100vh;
    }

    /* PC için orijinal header yapısını koru */
    .app-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1rem;
    }

    /* PC için mobil elementleri gizle */
    .mobile-header-left,
    .mobile-hamburger-container {
        display: none !important;
    }

    /* PC için orijinal header yapısını göster */
    .header-left,
    .header-right {
        display: flex;
        align-items: center;
    }

    .pc-only {
        display: flex !important;
    }

    .sidebar {
        width: 350px;
        min-width: 350px;
    }

    .chat-area {
        flex: 1;
    }

    .message {
        max-width: 60%;
    }

    .modal-content {
        max-width: 600px;
        width: 90%;
    }

    .auth-box {
        max-width: 500px;
    }

    /* PC için özel animasyonlar */
    .sidebar {
        transition: width 0.3s ease;
    }

    .sidebar.collapsed {
        width: 0;
        min-width: 0;
    }

    /* PC için hover efektleri */
    .user-item:hover {
        background-color: var(--light-gray);
        transform: translateX(5px);
    }

    /* Seçili kullanıcı hover'da yazı rengini değiştirme */
    .user-item.active:hover {
        background-color: #1B8BB4;
        color: var(--white);
        transform: translateX(5px);
    }

    .user-item.active:hover .user-item-name {
        color: var(--white);
    }

    .user-item.active:hover .user-item-birim {
        color: var(--white);
        opacity: 0.8;
    }

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    /* PC için menü dropdown */
    .user-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 0.5rem;
    }

    /* PC için dosya önizleme */
    .file-preview-item {
        max-width: 300px;
    }

    /* PC için mesaj aksiyonları */
    .message-actions-dropdown {
        position: relative;
    }

    .message-actions-toggle {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .message:hover .message-actions-toggle {
        opacity: 1;
    }

    /* PC için chat menüsü */
    .chat-menu-dropdown-content {
        min-width: 200px;
    }
}

/* Tablet Stilleri */
@media (max-width: 1023px) and (min-width: 768px) {

    /* Tablet için mobil elementleri gizle */
    .mobile-header-left,
    .mobile-hamburger-container {
        display: none !important;
    }

    /* Tablet için orijinal header yapısını göster */
    .header-left,
    .header-right {
        display: flex;
        align-items: center;
    }

    .pc-only {
        display: flex !important;
    }

    .sidebar {
        width: 300px;
        min-width: 300px;
    }

    .message {
        max-width: 70%;
    }

    .modal-content {
        max-width: 500px;
        width: 95%;
    }

    /* Boyut sınıfları için özel kurallar */
    .modal-content.small {
        max-width: 400px !important;
        width: 90% !important;
    }

    .modal-content.medium {
        max-width: 50% !important;
        width: 50% !important;
    }

    .modal-content.large {
        max-width: 800px !important;
        width: 90% !important;
    }

    .modal-content.xlarge {
        max-width: 1000px !important;
        width: 95% !important;
    }

    .modal-content.fullscreen {
        max-width: 95% !important;
        width: 95% !important;
    }

    .auth-box {
        max-width: 450px;
    }

    /* Tablet için sidebar toggle */
    .sidebar.collapsed {
        width: 0;
        min-width: 0;
        position: absolute;
        z-index: 1000;
        height: 100%;
    }

    /* Tablet için overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* Mobil Stilleri */
@media (max-width: 767px) {

    /* Mobil global overflow fix */
    .qr-download-container {
        display: none !important;
    }

    html,
    body {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100vw;
    }

    /* Mobil için temel düzen */
    .main-app {
        height: 100vh;
        overflow: hidden;
    }

    .app-header {
        padding: 0.375rem 1rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background-color: #1b8bb4;
        height: 55px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobil için header düzeni */
    .app-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.25rem 1rem;
    }

    /* Mobil için sol köşe - Logo ve başlık */
    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
    }

    .mobile-logo {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.8);
        padding: 2px;
        box-shadow: none;
        cursor: pointer;
        transition: all 0.3s ease;
        object-fit: contain;
    }

    .mobile-logo:hover {
        transform: scale(1.05);
    }

    .mobile-title {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        line-height: normal;
    }

    .mobile-main-title {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--white);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        cursor: pointer;
        letter-spacing: 0.5px;
    }

    .mobile-main-title:hover {
        opacity: 0.8;
    }

    .mobile-subtitle {
        font-size: 0.65rem;
        color: rgba(255, 255, 255, 0.9);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 300;
    }

    .mobile-nav-buttons {
        display: flex;
        align-items: center;
        gap: 0.15rem;
        /* Gap further reduced */
        margin-right: 0;
        /* Margin removed to bring closer to hamburger */
    }

    .mobile-nav-btn {
        width: 28px;
        /* Slightly smaller width */
        height: 28px;
        /* Slightly smaller height */
        font-size: 0.85rem;
        /* Slightly smaller icon */
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: white;
        border-radius: 50%;
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .mobile-nav-btn:active {
        background-color: rgba(255, 255, 255, 0.2);
    }

    /* Mobil hamburger menü */
    .mobile-hamburger-container {
        position: relative !important;
        z-index: 999998 !important;
        pointer-events: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .mobile-hamburger-menu {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 35px !important;
        height: 35px !important;
        background: #d1d5db !important;
        color: #374151 !important;
        border: none !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        font-size: 0.9rem !important;
        box-shadow: 0 2px 8px rgba(209, 213, 219, 0.3) !important;
        z-index: 999998 !important;
        position: relative !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .mobile-hamburger-menu:hover,
    .mobile-hamburger-menu:focus,
    .mobile-hamburger-menu:active {
        background: #9ca3af !important;
        transform: scale(1.05) !important;
        box-shadow: 0 4px 12px rgba(156, 163, 175, 0.4) !important;
        z-index: 999998 !important;
        outline: none !important;
    }

    .mobile-hamburger-menu i {
        font-size: 1rem;
    }

    .mobile-hamburger-dropdown {
        position: fixed !important;
        top: 55px !important;
        right: 0 !important;
        background: var(--white) !important;
        border-radius: 0 !important;
        box-shadow: var(--shadow-lg) !important;
        padding: 1rem !important;
        width: 250px !important;
        height: calc(100vh - 55px) !important;
        z-index: 999999 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateX(100%) !important;
        transition: all 0.3s ease !important;
        border-left: 1px solid #e2e8f0 !important;
        pointer-events: auto !important;
        display: block !important;
    }

    .mobile-hamburger-dropdown.active {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateX(0) !important;
        z-index: 999999 !important;
        pointer-events: auto !important;
        display: block !important;
    }

    /* Mobil hamburger dropdown içeriği için ek güvenlik */
    .mobile-hamburger-dropdown * {
        pointer-events: auto !important;
    }

    /* Mobil hamburger dropdown içeriği için ek güvenlik - daha güçlü */
    .mobile-hamburger-dropdown.active * {
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem;
        cursor: pointer;
        transition: all 0.3s ease;
        border-radius: var(--radius-sm);
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 1rem;
    }

    .mobile-user-info:hover {
        background-color: var(--light-gray);
        transform: translateX(3px);
    }

    .mobile-user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid var(--white);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .mobile-user-details {
        flex: 1;
        min-width: 0;
    }

    .mobile-user-details span {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--black);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mobil menü öğeleri */
    .mobile-menu-items {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.25rem !important;
        z-index: 999999 !important;
        position: relative !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .mobile-menu-item {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        padding: 0.875rem 1rem !important;
        color: var(--black) !important;
        text-decoration: none !important;
        border-radius: var(--radius-sm) !important;
        transition: all 0.3s ease !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .mobile-menu-item:hover {
        background-color: var(--light-gray);
        color: var(--accent-color);
        transform: translateX(3px);
    }

    .mobile-menu-item i {
        font-size: 1rem;
        width: 20px;
        text-align: center;
        color: var(--accent-color);
    }

    .mobile-menu-item span {
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-menu-divider {
        margin: 0.75rem 0;
        border: none;
        border-top: 1px solid #e2e8f0;
    }

    .mobile-logout-item {
        color: var(--danger-color) !important;
        background-color: #fef2f2;
        border: 1px solid #fecaca;
    }

    .mobile-logout-item:hover {
        background-color: #fee2e2 !important;
        color: var(--danger-color) !important;
        transform: translateX(3px);
    }

    .mobile-logout-item i {
        color: var(--danger-color) !important;
    }

    /* Mobil için merkezi başlık */
    .app-title {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        margin: 0 1rem;
    }

    .app-title img,
    .logo-image {
        display: none !important;
    }

    .title-text {
        text-align: center;
    }

    .main-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--primary-color);
        margin: 0;
        text-align: center;
    }

    .app-title .title-text span {
        display: none;
    }

    /* Mobil için kullanıcı bilgilerini gizle */
    .user-info img,
    .user-info span {
        display: none;
    }

    .user-menu-toggle {
        display: none;
    }

    /* Mobil için sağ köşe - Boş alan */
    .mobile-right-space {
        width: 32px;
        height: 32px;
        visibility: hidden;
    }

    /* Mobil için PC-only sınıfını gizle */
    .pc-only {
        display: none !important;
    }

    .app-content {
        margin-top: 55px;
        height: calc(100vh - 55px);
        z-index: 1 !important;
    }

    /* Mobil sidebar - Kart görünümü için */
    .sidebar {
        position: fixed;
        top: 55px;
        left: 0;
        bottom: 0;
        width: 100%;
        z-index: 1 !important;
        transform: translateX(0);
        /* İlk girişte görünür */
        transition: transform 0.3s ease;
        background-color: var(--white);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .sidebar.mobile-hidden {
        transform: translateX(-100%);
    }

    /* Mobil kart görünümü için özel stiller */
    .sidebar-header {
        padding: 0.5rem;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    /* Mobil geçiş butonlarını header'da göster */
    .mobile-nav-buttons {
        display: flex !important;
    }

    /* Mobil header düzenlemesi */
    .app-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
    }

    .mobile-header-left {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .mobile-title {
        flex: 1;
        min-width: 0;
    }

    .mobile-main-title {
        font-size: 0.9rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-subtitle {
        font-size: 0.75rem;
        opacity: 0.9;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-hamburger-container {
        margin-left: 0.5rem;
    }

    /* Mobil geçiş butonları için ek stiller */
    .mobile-nav-buttons {
        z-index: 10;
        position: relative;
        display: flex !important;
        gap: 6px;
        /* Butonlar arası boşluk */
        align-items: center;
    }

    .mobile-nav-btn {
        position: relative;
        z-index: 11;
        border-radius: 50% !important;
        -webkit-border-radius: 50% !important;
        -moz-border-radius: 50% !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        font-size: 0.9rem !important;
        /* İkon boyutu */
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
        /* Hafif transparan arka plan */
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        box-shadow: none !important;
    }

    .mobile-nav-btn:hover,
    .mobile-nav-btn:active {
        background-color: rgba(255, 255, 255, 0.3) !important;
    }

    .mobile-nav-btn i {
        position: relative;
        z-index: 12;
        pointer-events: none;
        color: white !important;
    }

    .sidebar-content {
        padding: 0.75rem;
        height: calc(100vh - 90px);
        /* Header ve search box için alan */
        overflow-y: auto;
    }

    .users-list {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0;
    }

    /* Mobil liste stili */
    .user-item {
        background: var(--white);
        border: 1px solid #e2e8f0;
        border-radius: var(--radius-md);
        padding: 0.25rem 0.375rem;
        margin: 0;
        box-shadow: var(--shadow-sm);
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-height: 35px;
        position: relative;
    }

    .user-item:hover {
        transform: translateX(3px);
        box-shadow: var(--shadow-md);
        border-color: var(--accent-color);
    }

    .user-item.active {
        background: var(--accent-color);
        border-color: var(--accent-color);
        color: var(--white);
        transform: translateX(5px);
        box-shadow: 0 4px 12px rgba(27, 139, 180, 0.3);
    }

    .user-item.active .user-item-name,
    .user-item.active .user-item-birim {
        color: var(--white);
    }

    /* Mobil liste içeriği - Avatar göster */
    .user-item img {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        /* Profil resmi için gölge */
        flex-shrink: 0;
        display: block !important;
        object-fit: cover;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .user-item-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
    }

    .user-item-details {
        width: 100%;
    }

    .user-item-name {
        font-size: 0.95rem;
        font-weight: 700;
        font-family: 'Nunito', sans-serif;
        margin-bottom: 0.125rem;
        color: var(--black);
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-item-birim {
        font-size: 0.85rem;
        font-family: 'Nunito', sans-serif;
        color: var(--gray);
        font-weight: 500;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-item.active .user-item-name {
        color: var(--white);
        font-weight: 700;
    }

    .user-item.active .user-item-birim {
        color: rgba(255, 255, 255, 0.9);
    }

    /* Mobil liste durum göstergesi */
    .user-item-status {
        position: absolute;
        top: 0.625rem;
        right: 0.625rem;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        border: 2px solid var(--white);
    }

    .user-item-status.online {
        background-color: var(--success-color);
        box-shadow: 0 0 0 2px var(--white);
    }

    .user-item-status.offline {
        background-color: var(--gray);
    }

    /* Mobil liste badge */
    .user-item-badge {
        position: absolute;
        top: 0.625rem;
        left: 0.625rem;
        background: var(--danger-color);
        color: var(--white);
        border-radius: 50%;
        width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.65rem;
        font-weight: 600;
        border: 2px solid var(--white);
    }

    .user-item.current-user {
        background: var(--accent-color);
        border-color: var(--accent-color);
        color: var(--white);
    }

    .user-item.current-user .user-item-name,
    .user-item.current-user .user-item-birim {
        color: var(--white);
    }

    /* Mobil overlay */
    .sidebar-overlay {
        position: fixed;
        top: 55px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobil chat area */
    .chat-area {
        width: 100%;
        display: none;
        /* İlk girişte gizli */
        z-index: 1 !important;
        overflow-x: hidden !important;
        /* Yatay kaydırmayı engelle */
    }

    .chat-area.mobile-active {
        display: block !important;
    }

    /* Mobil grup sohbeti için chat-area görünür yap */
    .chat-area[style*="display: flex"] {
        display: flex !important;
    }

    /* Mobil cihazlarda grup sohbeti açıldığında chat-area görünür yap */
    .chat-container:not(.hidden) .chat-area {
        display: flex !important;
    }

    /* Grup sohbeti aktif olduğunda chat-area görünür yap */
    .chat-area.group-chat-active {
        display: flex !important;
    }

    /* Mobil dashboard için overflow düzeltmesi */
    .chat-area.dashboard-mode {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    /* Mobil dashboard profil foto ve mesaj boyutları */
    .welcome-avatar .user-avatar {
        width: 80px !important;
        /* Profil foto alanını büyüt */
        height: 80px !important;
    }

    .welcome-message {
        font-size: 0.9rem !important;
        /* Karşılama mesajını küçült */
    }

    .welcome-name {
        font-size: 0.85rem !important;
        /* İsim alanını küçült */
    }

    .welcome-time {
        font-size: 0.7rem !important;
        /* Zaman alanını küçült */
    }

    .chat-container {
        height: 100%;
    }

    .messages-container {
        padding: 0.75rem;
        margin-bottom: 0;
        /* İlk girişte margin yok */
        overflow-x: hidden !important;
        /* Yatay kaydırmayı engelle */
    }

    .messages-container.mobile-active {
        margin-bottom: 100px;
        /* Sohbet aktifken margin */
    }

    .message {
        max-width: 85%;
    }

    .message-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--white);
        border-top: 1px solid #e2e8f0;
        padding: 0.75rem;
        z-index: 1 !important;
        display: none !important;
        /* İlk girişte gizli */
        visibility: hidden !important;
    }

    .message-input-container.mobile-active {
        display: block !important;
        visibility: visible !important;
    }

    /* Mobil mesaj gönderme düzeni */
    .message-input-wrapper {
        display: flex;
        align-items: flex-end;
        gap: 0.5rem;
        width: 100%;
    }

    /* Mobil ataç butonu - %10 genişlik */
    .attachment-btn {
        background: var(--accent-color);
        color: var(--white);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 10%;
        padding: 0;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: all 0.3s ease;
    }

    .attachment-btn:hover {
        background: var(--success-color);
        transform: scale(1.05);
    }

    /* Mobil mesaj yazma kutusu - %80 genişlik */
    .message-input {
        flex: 1;
        min-width: 0;
        max-width: 80%;
        display: block;
    }

    .message-input textarea {
        width: 100%;
        min-height: 40px;
        max-height: 120px;
        padding: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: var(--radius-md);
        resize: none;
        font-size: 16px;
        line-height: 1.4;
        font-family: inherit;
        display: block;
    }

    /* Mobil gönder butonu - %10 genişlik */
    #send-message-btn {
        background: var(--accent-color);
        color: var(--white);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 10%;
        padding: 0;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: all 0.3s ease;
    }

    #send-message-btn:hover:not(:disabled) {
        background: var(--success-color);
        transform: scale(1.05);
    }

    #send-message-btn:disabled {
        background: #9ca3af;
        color: #6b7280;
        cursor: not-allowed;
        opacity: 0.6;
    }

    /* Mobil modal */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Mobil auth */
    .auth-container {
        padding: 0.5rem;
    }

    .auth-box {
        max-width: 100%;
        border-radius: var(--radius-md);
    }

    .auth-header {
        padding: 1.5rem;
    }

    .auth-form {
        padding: 1.5rem;
    }

    /* Mobil kullanıcı menüsü */
    .user-dropdown {
        position: fixed;
        top: 50px;
        right: 0;
        left: 0;
        border-radius: 0;
        border-top: 1px solid #e2e8f0;
        box-shadow: var(--shadow-lg);
    }



    /* Mobil mesaj aksiyonları */
    .message-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.25rem;
    }

    .message-actions-dropdown {
        position: relative;
    }

    .message-actions-toggle {
        opacity: 1;
        visibility: visible;
        background-color: var(--accent-color);
        color: var(--white);
        border-radius: 50%;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.6rem;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(27, 139, 180, 0.3);
    }

    .message-actions-toggle:hover {
        background-color: var(--success-color);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(27, 139, 180, 0.4);
    }

    .message-actions-menu {
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 0.5rem;
        background-color: var(--white);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        padding: 0.375rem;
        z-index: 1001;
        min-width: 120px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        border: 1px solid #e2e8f0;
    }

    .message-actions-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .message-actions-menu::before {
        display: none;
    }

    .message-actions-menu::after {
        display: none;
    }

    .message-actions-menu .dropdown-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        color: var(--black);
        text-decoration: none;
        border-radius: var(--radius-sm);
        transition: all 0.3s ease;
        font-size: 0.8rem;
        font-weight: 500;
    }

    .message-actions-menu .dropdown-item:hover {
        background-color: var(--light-gray);
        color: var(--accent-color);
        transform: translateX(3px);
    }

    .message-actions-menu .dropdown-item i {
        font-size: 0.85rem;
        width: 14px;
        text-align: center;
    }

    .message-actions-menu .dropdown-item.delete {
        color: var(--danger-color);
    }

    .message-actions-menu .dropdown-item.delete:hover {
        background-color: #fef2f2;
        color: var(--danger-color);
    }

    /* Mobil touch optimizasyonları */
    .user-item {
        padding: 0.375rem 0.5rem;
        min-height: 40px;
    }

    /* Mobil mevcut kullanıcı stili */
    .user-item.current-user {
        transform: translateX(3px);
        box-shadow: 0 3px 8px rgba(30, 58, 138, 0.15);
    }

    .user-item.current-user:hover {
        transform: translateX(5px);
        box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
    }

    .btn {
        min-height: 44px;
        padding: 0.875rem 1.25rem;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobil için yeni sohbet butonu - gizle */
    #new-chat-btn {
        display: none !important;
    }

    #new-chat-btn:hover {
        background-color: var(--success-color);
        color: var(--white);
        transform: scale(1.05);
    }

    #new-chat-btn i {
        font-size: 12px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Attachment modalındaki gönder butonu için özel boyut */
    .attachment-actions #send-with-attachments-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        font-size: 0.8rem !important;
    }

    /* Mobil input optimizasyonları */
    .message-input textarea {
        min-height: 44px;
        font-size: 16px;
        /* iOS zoom önleme */
    }

    /* Mobil arama kutusu ikonu */
    .search-box i {
        position: absolute;
        left: 0.625rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray);
        font-size: 0.875rem;
    }

    .search-box input {
        min-height: 32px;
        font-size: 16px;
        padding: 0.375rem 0.75rem 0.375rem 2.25rem;
    }

    /* Mobil bildirimler - Kompakt tasarım */
    .notification {
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        left: auto !important;
        max-width: 320px !important;
        width: auto !important;
        background-color: var(--white) !important;
        color: var(--black) !important;
        padding: 0.375rem 0.75rem !important;
        border-radius: var(--radius-md) !important;
        box-shadow: var(--shadow-lg) !important;
        z-index: 1002 !important;
        transform: translateX(100%) !important;
        transition: transform 0.3s ease !important;
        font-size: 0.875rem !important;
        line-height: 1.2 !important;
        border: 1px solid #e2e8f0 !important;
        min-height: auto !important;
        max-height: 70px !important;
        text-align: left !important;
    }

    .notification.show {
        transform: translateX(0) !important;
    }

    .notification-content {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 3rem !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: left !important;
    }

    .notification-content i {
        font-size: 0.875rem !important;
        margin-top: 0 !important;
        flex-shrink: 0 !important;
    }

    .notification-content div {
        flex: 1 !important;
        min-width: 0 !important;
        text-align: left !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }

    .notification-content strong {
        display: inline !important;
        font-weight: 600 !important;
        margin-bottom: 0 !important;
        font-size: 0.875rem !important;
        line-height: 1.2 !important;
    }

    .notification-content p {
        margin: 0 !important;
        font-size: 0.8rem !important;
        opacity: 0.8 !important;
        line-height: 1.2 !important;
        display: inline !important;
    }

    /* Mobil swipe gestures */
    .chat-container {
        touch-action: pan-y;
    }

    /* Mobil için chat menüsü */
    .chat-menu-dropdown-content {
        min-width: 160px;
        right: -0.5rem;
    }

    .chat-menu-item {
        padding: 1rem 1.25rem;
        min-height: 48px;
    }

    /* Mobil attachment menü - Yeniden eklendi */
    .attachment-menu {
        width: 180px;
        bottom: 110%;
        left: 0.5rem;
        z-index: 10001 !important;
        /* Ensure it's above other elements */
    }

    .attachment-menu-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
        touch-action: manipulation;
        /* Improve touch response */
        cursor: pointer;
    }

    .attachment-menu-item:hover,
    .attachment-menu-item:active,
    .attachment-menu-item:focus {
        background-color: #f1f5f9 !important;
        color: var(--accent-color) !important;
    }

    /* Message Actions Menu - Mobile Optimization */
    .message-actions-menu {
        min-width: auto !important;
        width: auto !important;
        padding: 2px !important;
        /* Reduced padding */
    }

    .message-actions-menu button {
        padding: 2px 6px !important;
        /* Reduced padding */
        font-size: 0.7rem !important;
        /* Slightly smaller font */
        gap: 0.2rem !important;
        white-space: nowrap !important;
        line-height: 1.2 !important;
        /* Tighter line height */
        min-height: auto !important;
        /* Override any min-height */
        height: auto !important;
    }

    .message-actions-menu button i {
        font-size: 0.6rem !important;
        /* Icons reduced further */
    }

    .messages-container {
        touch-action: pan-y;
    }

    /* Mobil keyboard handling */
    .message-input-container.keyboard-open {
        position: fixed;
        bottom: 0;
    }

    /* Mobil landscape */
    @media (orientation: landscape) and (max-height: 500px) {
        .app-header {
            padding: 0.25rem 1rem;
            background-color: #1b8bb4;
        }

        .app-content {
            margin-top: 50px;
            height: calc(100vh - 50px);
        }

        .sidebar {
            top: 50px;
        }

        .sidebar-overlay {
            top: 50px;
        }

        .user-dropdown {
            top: 50px;
        }

        .notification {
            top: 0.75rem !important;
            right: 0.75rem !important;
            left: auto !important;
            max-width: 300px !important;
            padding: 0.3rem 0.6rem !important;
            font-size: 0.8rem !important;
            background-color: var(--white) !important;
            color: var(--black) !important;
            border: 1px solid #e2e8f0 !important;
            max-height: 60px !important;
            text-align: center !important;
        }

        .notification-content strong {
            font-size: 0.8rem !important;
        }

        .notification-content p {
            font-size: 0.75rem !important;
        }
    }
}

/* Küçük mobil cihazlar */
@media (max-width: 480px) {
    .app-header {
        padding: 0.25rem;
        height: 55px;
        background-color: #1b8bb4;
    }

    /* Küçük mobil için logo ve başlık */
    .mobile-logo {
        width: 40px;
        height: 40px;
    }

    .mobile-main-title {
        font-size: 0.9rem;
        color: var(--white);
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .mobile-main-title:hover {
        opacity: 0.8;
    }

    .mobile-subtitle {
        font-size: 0.65rem;
        color: rgba(255, 255, 255, 0.8);
    }

    /* Küçük mobil için hamburger menü */
    .mobile-hamburger-menu {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
        z-index: 99998;
    }

    /* Küçük mobil için hamburger dropdown */
    .mobile-hamburger-dropdown {
        top: 55px;
        right: 0;
        width: 260px;
        height: calc(100vh - 55px);
        z-index: 999999 !important;
    }

    .mobile-hamburger-menu i {
        font-size: 1rem;
    }

    .app-title {
        font-size: 0.9rem;
    }

    .app-title span {
        display: none;
    }

    .user-info span {
        display: none;
    }

    .main-title {
        font-size: 1rem;
    }

    /* Küçük mobil için sağ boşluk */
    .mobile-right-space {
        width: 28px;
        height: 28px;
    }

    /* Küçük mobil için kart görünümü optimizasyonu */
    .sidebar-content {
        padding: 0.5rem;
    }

    .users-list {
        gap: 0.25rem;
    }

    .user-item {
        min-height: 35px;
        padding: 0.375rem 0.5rem;
    }

    .user-item img {
        width: 25px;
        height: 25px;
        border-radius: 50%;
        border: 2px solid var(--white);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        flex-shrink: 0;
        display: block !important;
        object-fit: cover;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .user-item-name {
        font-size: 0.9rem;
        font-weight: 700;
        font-family: 'Nunito', sans-serif;
        margin-bottom: 0.125rem;
    }

    .user-item-birim {
        font-size: 0.75rem;
        font-weight: 500;
        font-family: 'Nunito', sans-serif;
        margin-bottom: 0;
    }

    .user-item-status {
        width: 8px;
        height: 8px;
        top: 0.625rem;
        right: 0.625rem;
    }

    .user-item-badge {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
        top: 0.625rem;
        left: 0.625rem;
    }

    .chat-header {
        padding: 0.375rem;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .chat-header:hover {
        background-color: rgba(27, 139, 180, 0.1);
    }

    .chat-user-info img {
        width: 2.75rem;
        height: 2.75rem;
    }

    .chat-user-info .user-details h4 {
        font-size: 1rem;
    }

    .message {
        max-width: 90%;
    }

    .message-content {
        padding: 0.375rem 0.5rem;
    }

    .message-input-container {
        padding: 0.5rem;
    }

    .message-input-wrapper {
        gap: 0.5rem;
    }

    /* Küçük mobil için mesaj aksiyonları */
    .message-actions-toggle {
        width: 18px;
        height: 18px;
        font-size: 0.55rem;
    }

    .message-actions-menu {
        min-width: 100px;
        padding: 0.25rem;
    }

    .message-actions-menu .dropdown-item {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }



    .attachment-preview {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .attachment-item {
        padding: 0.5rem;
    }

    .attachment-item img {
        height: 120px;
    }

    /* Mobil cihazlarda sürükleme alanını gizle */
    .drag-drop-area {
        display: none !important;
    }

    .auth-header {
        padding: 1rem;
    }

    .auth-form {
        padding: 1rem;
    }

    .auth-form h2 {
        font-size: 1.25rem;
    }

    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }

    /* Mobil için boyut sınıfları */
    .modal-content.small,
    .modal-content.medium,
    .modal-content.large,
    .modal-content.xlarge,
    .modal-content.fullscreen {
        max-width: 95% !important;
        width: 95% !important;
        max-height: 90vh !important;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* Çok küçük mobil cihazlar */
@media (max-width: 360px) {
    .app-header {
        padding: 0.25rem;
        height: 50px;
        background-color: #1b8bb4;
    }

    /* Çok küçük mobil için logo ve başlık */
    .mobile-logo {
        width: 35px;
        height: 35px;
    }

    .mobile-main-title {
        font-size: 0.8rem;
        color: var(--white);
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .mobile-main-title:hover {
        opacity: 0.8;
    }

    .mobile-subtitle {
        font-size: 0.6rem;
        color: rgba(255, 255, 255, 0.8);
    }

    /* Çok küçük mobil için hamburger menü */
    .mobile-hamburger-menu {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
        z-index: 99998;
    }

    /* Çok küçük mobil için hamburger dropdown */
    .mobile-hamburger-dropdown {
        top: 50px;
        right: 0;
        width: 240px;
        height: calc(100vh - 50px);
        z-index: 999999 !important;
    }

    .mobile-hamburger-menu i {
        font-size: 0.9rem;
    }

    .app-title i {
        font-size: 1.25rem;
    }

    .main-title {
        font-size: 0.9rem;
    }

    /* Çok küçük mobil için sağ boşluk */
    .mobile-right-space {
        width: 24px;
        height: 24px;
    }

    /* Çok küçük mobil için kart görünümü optimizasyonu */
    .sidebar-content {
        padding: 0.375rem;
    }

    .users-list {
        gap: 0.25rem;
    }

    .user-item {
        min-height: 30px;
        padding: 0.25rem 0.375rem;
    }

    .user-item img {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 2px solid var(--white);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        flex-shrink: 0;
        display: block !important;
    }

    .user-item-name {
        font-size: 0.85rem;
        font-weight: 700;
        font-family: 'Nunito', sans-serif;
        margin-bottom: 0.125rem;
    }

    .user-item-birim {
        font-size: 0.7rem;
        font-weight: 500;
        font-family: 'Nunito', sans-serif;
        margin-bottom: 0;
    }

    .user-item-status {
        width: 7px;
        height: 7px;
        top: 0.5rem;
        right: 0.5rem;
    }

    .user-item-badge {
        width: 14px;
        height: 14px;
        font-size: 0.6rem;
        top: 0.5rem;
        left: 0.5rem;
    }

    .chat-header {
        padding: 0.25rem;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .chat-header:hover {
        background-color: rgba(27, 139, 180, 0.1);
    }

    .messages-container {
        padding: 0.5rem;
    }

    .message {
        max-width: 95%;
    }

    .message-content {
        padding: 0.375rem 0.5rem;
    }

    .message-input-container {
        padding: 0.5rem;
    }

    /* Çok küçük mobil için mesaj aksiyonları */
    .message-actions-toggle {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
    }

    .message-actions-menu {
        min-width: 90px;
        padding: 0.125rem;
    }

    .message-actions-menu .dropdown-item {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .attachment-preview {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .attachment-item {
        padding: 0.375rem;
    }

    .attachment-item img {
        height: 100px;
    }

    /* Mobil cihazlarda sürükleme alanını gizle */
    .drag-drop-area {
        display: none !important;
    }



    /* Attachment modalındaki gönder butonu için özel boyut */
    .attachment-actions #send-with-attachments-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        font-size: 0.8rem !important;
    }

    .auth-header {
        padding: 0.75rem;
    }

    .auth-form {
        padding: 0.75rem;
    }

    .auth-header h1 {
        font-size: 1.125rem;
    }

    .auth-form h2 {
        font-size: 1.125rem;
    }

    /* Çok küçük mobil için notification */
    .notification {
        top: 0.5rem !important;
        right: 0.5rem !important;
        left: auto !important;
        max-width: 280px !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
        background-color: var(--white) !important;
        color: var(--black) !important;
        border: 1px solid #e2e8f0 !important;
        max-height: 55px !important;
        text-align: left !important;
    }

    .notification-content strong {
        font-size: 0.75rem !important;
    }

    .notification-content p {
        font-size: 0.7rem !important;
    }
}

/* Yüksek DPI ekranlar */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .user-item img,
    .chat-user-info img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Karanlık mod desteği (gelecekte) */
@media (prefers-color-scheme: dark) {
    /* Karanlık mod stilleri buraya eklenebilir */
}

/* Azaltılmış hareket tercihi */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .sidebar,
    .modal-content,
    .message-actions,
    .notification {
        transition: none;
    }
}

/* Yazdırma stilleri */
@media print {
    .main-app {
        display: none;
    }

    .auth-container {
        display: none;
    }
}