* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Corporate Color Palette */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    /* Background Colors */
    --bg-color: #f8fafc;
    --bg-secondary: #f1f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --topbar-bg: #ffffff;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Border & Shadow */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login Page - Modern Corporate Style */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
    opacity: 0.1;
}

.login-card {
    background: var(--card-bg);
    padding: var(--spacing-2xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.login-card h1 {
    text-align: center;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    font-size: 15px;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    transition: var(--transition);
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

/* Buttons - Modern Style */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-inverse);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #475569;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--text-inverse);
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--text-inverse);
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
}

.btn-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* Messages */
.error-message {
    background-color: #fef2f2;
    color: var(--danger-color);
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.success-message {
    background-color: #f0fdf4;
    color: #166534;
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    border: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.help-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-color);
}

/* Sidebar - Modern Corporate */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f172a 100%);
    color: var(--text-inverse);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

.sidebar-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    padding: var(--spacing-md) 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px var(--spacing-xl);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    margin: 2px var(--spacing-md);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 14px;
    position: relative;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: var(--text-inverse);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    box-shadow: var(--shadow);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--text-inverse);
    border-radius: 0 2px 2px 0;
}

.nav-item .icon {
    margin-right: var(--spacing-md);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    background: var(--topbar-bg);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
}

.content-area {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
    background: var(--bg-color);
}

/* Cards - Modern Style */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

/* Stats Cards - Enhanced */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--card-bg);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(30, 64, 175, 0.1) 100%);
    flex-shrink: 0;
}

.stat-card .stat-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--primary-color);
}

.stat-card .stat-info {
    flex: 1;
    margin-left: var(--spacing-lg);
}

.stat-card .stat-info h3 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-info .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-card .stat-info .stat-change {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 600;
}

/* Tables - Modern Style */
.table-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:hover {
    background-color: var(--bg-secondary);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Forms */
.form-container {
    background: var(--card-bg);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    max-width: 700px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

/* Badges - Modern Style */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-info {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Loading */
.loading {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 60px;
        overflow: visible;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: var(--spacing-sm);
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-item {
        white-space: nowrap;
        margin: 0 var(--spacing-xs);
        touch-action: manipulation;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: var(--spacing-lg);
    }
    
    .topbar {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .topbar h1 {
        font-size: 20px;
    }
    
    .notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .card {
        padding: var(--spacing-lg);
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Chat Items */
.chat-item {
    transition: var(--transition);
}

.chat-item:hover {
    transform: translateX(4px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   WhatsApp Style Chat Interface
   ============================================ */

.chat-container {
    display: flex;
    height: calc(100vh - 180px);
    min-height: 500px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Sol Panel - Sohbet Listesi */
.chat-sidebar {
    width: 350px;
    min-width: 280px;
    max-width: 400px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
}

.chat-sidebar-header {
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.chat-search-box {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.chat-search-box input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background: var(--card-bg);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.chat-search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    background: var(--card-bg);
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.chat-list-item:hover {
    background: var(--bg-secondary);
}

.chat-list-item.active {
    background: rgba(37, 99, 235, 0.08);
    border-left: 3px solid var(--primary-color);
}

.chat-list-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-avatar.user {
    background: linear-gradient(135deg, #10b981, #059669);
}

.chat-avatar.group {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.chat-avatar.channel {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.chat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chat-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.chat-time {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-badge {
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Sağ Panel - Mesajlar */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.chat-main-header {
    padding: 12px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.chat-main-header .chat-avatar {
    width: 45px;
    height: 45px;
    font-size: 18px;
}

.chat-main-info {
    flex: 1;
}

.chat-main-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.chat-main-status {
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-main-actions {
    display: flex;
    gap: 8px;
}

.chat-main-actions button {
    padding: 8px 12px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-main-actions button:hover {
    background: var(--primary-color);
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-date-divider {
    text-align: center;
    margin: 16px 0;
}

.message-date-divider span {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.message-bubble {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 12px;
    position: relative;
    word-break: break-word;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.message-bubble .message-text {
    white-space: pre-wrap;
}

.message-bubble.incoming {
    align-self: flex-start;
    background: var(--card-bg);
    border-bottom-left-radius: 4px;
}

.message-bubble.outgoing {
    align-self: flex-end;
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.message-media {
    color: var(--text-secondary);
    font-style: italic;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.message-bubble.outgoing .message-time {
    color: #667c5c;
}

/* Mesaj Input */
.chat-input-area {
    padding: 12px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.chat-input-area input:focus {
    border-color: var(--primary-color);
}

.chat-input-area button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-input-area button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.chat-input-area button svg {
    width: 22px;
    height: 22px;
}

/* Boş durum */
.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 40px;
    text-align: center;
    background: var(--bg-secondary);
}

.chat-empty-state svg {
    width: 100px;
    height: 100px;
    opacity: 0.3;
    margin-bottom: 24px;
}

.chat-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-empty-state p {
    font-size: 14px;
    max-width: 300px;
}

/* Grup Üyeleri Modal */
.members-list {
    max-height: 400px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.member-item:hover {
    background: var(--bg-secondary);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.member-username {
    font-size: 12px;
    color: var(--text-secondary);
}

.member-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--warning-color);
    color: white;
    font-weight: 600;
}

/* Mobil uyumluluk */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: calc(100vh - 140px);
    }
    
    .chat-sidebar {
        width: 100%;
        max-width: none;
        height: 40%;
        min-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .chat-main {
        height: 60%;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

/* Spin animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== REAL-TIME INDICATOR ========== */
.realtime-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success-color);
}

.realtime-indicator .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.realtime-indicator .status-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.realtime-indicator.paused {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning-color);
}

.realtime-indicator.paused .pulse-dot {
    background-color: var(--warning-color);
    animation: none;
}

/* Notification Toggle Button */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.btn-icon.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* New Message Animation */
@keyframes newMessage {
    0% {
        background-color: rgba(37, 99, 235, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

.chat-list-item.new-message {
    animation: newMessage 2s ease-out;
}

.message-bubble.new {
    animation: newMessage 2s ease-out;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounceIn 0.3s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Connection Status in Sidebar */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin: 8px 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    color: var(--success-color);
}

.connection-status.disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.connection-status .dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}

/* ========== UNREAD MESSAGES BADGE ========== */
.chat-list-item .chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 50px;
}

.chat-list-item .chat-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.chat-list-item.has-unread .chat-time {
    color: var(--primary-color);
    font-weight: 600;
}

.chat-list-item.has-unread .chat-name {
    font-weight: 700;
}

.chat-list-item.has-unread .chat-preview {
    color: var(--text-primary);
    font-weight: 500;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Okunmamış mesajı olan sohbet öğesi vurgusu */
.chat-list-item.has-unread {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent);
    border-left: 3px solid var(--primary-color);
}

.chat-list-item.has-unread:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.05));
}

/* Yeni mesaj animasyonu */
.chat-list-item.new-message-flash {
    animation: messageFlash 1s ease-out;
}

@keyframes messageFlash {
    0%, 50% {
        background-color: rgba(37, 99, 235, 0.2);
    }
    100% {
        background-color: transparent;
    }
}
