/* ===================================================
   AVERON - DISCORD INSPIRED PROFESSIONAL THEME
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Discord-like Colors */
    --primary: #5865F2;
    --primary-hover: #4752C4;
    --primary-dark: #3C45A5;
    
    /* Backgrounds */
    --bg-primary: #36393F;
    --bg-secondary: #2F3136;
    --bg-tertiary: #282B30;
    --bg-quaternary: #1E1F25;
    --bg-hover: #40444B;
    
    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #B9BBBE;
    --text-muted: #72767D;
    --text-link: #00B0F4;
    
    /* Status Colors */
    --status-online: #43B581;
    --status-idle: #FAA61A;
    --status-dnd: #F04747;
    --status-offline: #747F8D;
    
    /* Utility */
    --border-radius: 8px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== MAIN APP LAYOUT ===== */
.main-app {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 72px;
    height: 100vh;
    background: var(--bg-quaternary);
    border-right: 1px solid rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    overflow-y: auto;
    gap: 8px;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 8px;
}

.user-profile {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, #4752C4 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.user-profile:hover {
    border-radius: 30%;
    transform: scale(1.05);
}

.servers-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
}

.server-item {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.server-item:hover {
    background: var(--primary);
    border-radius: 16px;
    transform: scale(1.05);
}

.server-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: 16px;
    border-left: 3px solid var(--text-primary);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.add-btn {
    background: var(--bg-tertiary);
    font-size: 24px;
    color: var(--status-online);
    margin-top: auto;
}

.add-btn:hover {
    background: var(--status-online);
    color: white;
    border-radius: 12px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

/* ===== CHANNELS PANEL ===== */
.channels-panel {
    width: 240px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.channels-header {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channels-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.channels-list {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.channel-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.channel-item.active {
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.2) 0%, transparent 100%);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.direct-messages {
    padding: 12px 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.direct-messages h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 0 8px;
    letter-spacing: 0.5px;
}

.dm-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ===== CHAT AREA ===== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    flex-shrink: 0;
    height: 48px;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-type {
    color: var(--text-muted);
    font-size: 16px;
}

.chat-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-actions {
    display: flex;
    gap: 12px;
}

/* ===== MESSAGES CONTAINER ===== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--bg-primary);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}

.message {
    display: flex;
    gap: 12px;
    padding: 4px 0;
}

.message:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 4px 8px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #4752C4 100%);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.message-timestamp {
    font-size: 11px;
    color: var(--text-muted);
}

.message-text {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* ===== INPUT AREA ===== */
.message-input-area {
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 10px 12px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    min-height: 20px;
    max-height: 200px;
    resize: none;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    transition: var(--transition);
    border-radius: 4px;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* ===== USER PANEL ===== */
.user-panel {
    width: 240px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.user-panel-header {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.user-panel-header h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.users-list {
    flex: 1;
    padding: 8px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 440px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-primary);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* ===== STATUS DOTS ===== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--status-online);
    box-shadow: 0 0 6px rgba(67, 181, 129, 0.6);
}

.status-dot.away {
    background: var(--status-idle);
}

.status-dot.offline {
    background: var(--status-offline);
}

.hidden {
    display: none !important;
}

/* ===================================================
   LIGHT MODE (GÜNDÜZ MODU)
   =================================================== */

[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F3F5;
    --bg-tertiary: #E3E5E8;
    --bg-quaternary: #EBEDEF;
    --bg-hover: #DCDDDE;
    
    --text-primary: #060607;
    --text-secondary: #4E5058;
    --text-muted: #80848E;
    
    --primary: #5865F2;
    --primary-hover: #4752C4;
    
    --status-online: #23A55A;
    --status-idle: #F0B232;
    --status-dnd: #F23F43;
    --status-offline: #80848E;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #B5B9BD;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

[data-theme="light"] .sidebar,
[data-theme="light"] .channels-panel,
[data-theme="light"] .user-panel,
[data-theme="light"] .chat-header,
[data-theme="light"] .message-input-area {
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .input-wrapper {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .channel-item:hover {
    background: rgba(88, 101, 242, 0.08);
}

[data-theme="light"] .modal-content {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .server-item {
    background: #E3E5E8;
}

[data-theme="light"] .server-item:hover {
    background: var(--primary);
}

[data-theme="light"] .message:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ===================================================
   MESAJ ITEM STİLLERİ - KEsİN ÇÖZÜM
   =================================================== */

.message-item {
    display: flex !important;
    gap: 12px !important;
    margin: 12px 0 !important;
    padding: 8px !important;
    border-radius: 6px !important;
    transition: background 0.2s ease !important;
}

.message-item:hover {
    background: var(--bg-hover) !important;
}

.message-avatar {
    width: 40px !important;
    height: 40px !important;
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
}

.message-body {
    flex: 1 !important;
    min-width: 0 !important;
}

.message-header {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    margin-bottom: 4px !important;
}

.message-username {
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
}

.message-time {
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

.message-text {
    margin-top: 6px !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
}

/* ===== LIGHT MODE - YAZI RENKLERİ KOYU ===== */

[data-theme="light"] .message-item:hover {
    background: rgba(88, 101, 242, 0.08) !important;
}

[data-theme="light"] .message-text {
    color: #2E3338 !important;
}

[data-theme="light"] .message-username {
    color: #060607 !important;
}

[data-theme="light"] .message-time {
    color: #5E6772 !important;
}

[data-theme="light"] .message-file-container {
    background: var(--bg-tertiary) !important;
}

[data-theme="light"] .btn-icon:hover {
    background: rgba(88, 101, 242, 0.1) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .user-panel {
        display: none;
    }
    
    .channels-panel {
        width: 200px;
    }
}