/* Koyu-Mor Discord Teması */
:root {
    --bg-primary: #1e1433;
    --bg-secondary: #1a1129;
    --bg-tertiary: #150d1f;
    --bg-quaternary: #251a35;
    --bg-floating: #0f0818;
    --text-normal: #ffffff;
    --text-muted: #b9b9b9;
    --text-link: #7c3aed;
    --interactive-normal: #e0e0e0;
    --interactive-hover: #ffffff;
    --interactive-active: #fff;
    --interactive-muted: #6b5b7d;
    --channels-default: #c4c4c4;
    --channel-icon: #c4c4c4;
    --accent-primary: #7c3aed;
    --accent-hover: #6d28d9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-tertiary);
    color: var(--text-normal);
    overflow: hidden;
}

/* Login Sayfası */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.295) 0%, rgba(0, 0, 0, 0.712) 100%),
                url('/img/Back1.gif') center/cover;
    padding: 20px;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.158);
    z-index: 0;
}

.login-box {
    background: rgba(30, 20, 51, 0.39);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 100%;
    animation: fadeInUp 0.3s ease;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box h2 {
    color: var(--text-normal);
    text-align: center;
    margin-bottom: 10px;
}

.login-box .text-muted {
    color: var(--text-muted) !important;
    text-align: center;
}

.login-box .form-control {
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-quaternary);
    color: var(--text-normal);
    padding: 12px;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.login-box .form-control:focus {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-normal);
    box-shadow: none;
}

.login-box .form-control::placeholder {
    color: var(--text-muted);
}

.login-box .btn-primary {
    background: var(--accent-primary);
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
}

.login-box .btn-primary:hover {
    background: var(--accent-hover);
}

.login-box .alert {
    background: #dc2626;
    border: none;
    color: white;
}

.login-box .form-text {
    color: var(--text-muted);
}

/* Discord Container */
.discord-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sunucu Sidebar (Sol) */
.servers-sidebar {
    width: 72px;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    overflow-y: auto;
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-decoration: none;
    color: var(--text-normal);
}

.server-icon::before {
    content: '';
    position: absolute;
    left: -16px;
    width: 8px;
    height: 0;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
    transition: height 0.2s;
}

.server-icon:hover {
    border-radius: 16px;
    background: var(--accent-primary);
}

.server-icon:hover::before {
    height: 20px;
}

.server-icon.active {
    border-radius: 16px;
    background: var(--accent-primary);
}

.server-icon.active::before {
    height: 40px;
}

.server-icon img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.server-acronym {
    font-size: 16px;
    font-weight: 600;
}

.home-icon {
    background: var(--bg-primary);
}

.server-separator {
    width: 32px;
    height: 2px;
    background: var(--bg-quaternary);
    margin: 8px 0;
    border-radius: 1px;
}

/* Kanallar Sidebar */
.channels-sidebar {
    width: 350px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.guild-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bg-tertiary);
    cursor: pointer;
    transition: background 0.2s;
}

.guild-header:hover {
    background: var(--bg-quaternary);
}

.guild-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-normal);
    margin: 0;
}

.channels-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.channel-category {
    display: flex;
    align-items: center;
    padding: 8px 8px 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 16px;
}

.channel-category:first-child {
    margin-top: 0;
}

.channel-category i {
    margin-right: 4px;
    font-size: 10px;
}

.channel-item, .voice-channel-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    color: var(--channels-default);
    cursor: pointer;
    transition: all 0.2s;
}

.channel-item:hover, .voice-channel-item:hover {
    background: var(--bg-quaternary);
    color: var(--interactive-hover);
}

.channel-item.active {
    background: var(--bg-quaternary);
    color: var(--interactive-active);
}

.channel-item i, .voice-channel-item i {
    margin-right: 8px;
    font-size: 18px;
    color: var(--channel-icon);
}

.channel-item.active i {
    color: var(--interactive-active);
}

.voice-channel-item {
    justify-content: space-between;
}

.voice-channel-item span:first-of-type {
    flex: 1;
}

.voice-limit {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* User Panel (Alt) */
.user-panel {
    height: 48px;
    background: var(--bg-quaternary);
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background: #10b981;
}

.status-indicator.idle {
    background: #f59e0b;
}

.status-indicator.dnd {
    background: #ef4444;
}

.status-indicator.offline {
    background: #6b7280;
}

.user-controls a {
    color: var(--interactive-normal);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.user-controls a:hover {
    background: var(--bg-tertiary);
    color: var(--interactive-hover);
}

/* Ana İçerik - Mesajlar */
.main-content {
    flex: 1;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.channel-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--bg-tertiary);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.channel-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-normal);
}

.channel-name i {
    color: var(--text-muted);
}

.messages-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.welcome-message i {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.welcome-message h3 {
    color: var(--text-normal);
    margin-bottom: 8px;
}

.message-item {
    padding: 8px 16px;
    margin: 4px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.message-item:hover {
    background: rgba(124, 58, 237, 0.1);
}

.message-item.selected {
    background: rgba(124, 58, 237, 0.3);
    border-left: 3px solid var(--accent-primary);
}

.message-author {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.message-author img {
    margin-right: 8px;
    border-radius: 50%;
}

.message-author-name {
    font-weight: 600;
    color: var(--text-normal);
}

.message-timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.message-content {
    color: var(--text-normal);
    word-wrap: break-word;
    margin-left: 56px;
    line-height: 1.5;
}

.message-content-only {
    color: var(--text-normal);
    word-wrap: break-word;
    margin-left: 56px;
    padding: 2px 0;
    line-height: 1.5;
}

.message-item.compact {
    padding: 0 16px;
    margin: 0;
}

.message-item.compact:hover {
    background: rgba(124, 58, 237, 0.1);
}

/* System Messages */
.system-message {
    padding: 8px 16px;
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.system-message i {
    font-size: 16px;
}

.system-message strong {
    color: var(--text-normal);
    font-weight: 600;
}

/* Discord mesaj formatlaması */
.message-content strong,
.message-content-only strong {
    font-weight: 700;
}

.message-content em,
.message-content-only em {
    font-style: italic;
}

.message-content u,
.message-content-only u {
    text-decoration: underline;
}

.message-content del,
.message-content-only del {
    text-decoration: line-through;
    opacity: 0.7;
}

.message-content code,
.message-content-only code {
    background: var(--bg-quaternary);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.message-content pre,
.message-content-only pre {
    background: var(--bg-quaternary);
    padding: 8px;
    border-radius: 4px;
    margin: 4px 0;
    overflow-x: auto;
}

.message-content pre code,
.message-content-only pre code {
    background: none;
    padding: 0;
}

.mention {
    background: rgba(124, 58, 237, 0.3);
    color: #a78bfa;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mention:hover {
    background: rgba(124, 58, 237, 0.5);
    color: #c4b5fd;
}

.mention-everyone {
    background: rgba(237, 66, 69, 0.3);
    color: #ed4245;
    font-weight: 600;
}

.mention-everyone:hover {
    background: rgba(237, 66, 69, 0.5);
}

.discord-invite {
    background: rgba(88, 101, 242, 0.2);
    color: #5865f2;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.discord-invite:hover {
    background: rgba(88, 101, 242, 0.3);
    text-decoration: none;
}

.embed-link {
    background: rgba(254, 231, 92, 0.2);
    color: #fee75c;
    padding: 4px 8px;
    border-radius: 4px;
}

.embed-link:hover {
    background: rgba(254, 231, 92, 0.3);
}

.message-link {
    color: #60a5fa;
    text-decoration: none;
    transition: all 0.2s;
}

.message-link:hover {
    text-decoration: underline;
    color: #93c5fd;
}

/* Quote (>) */
.quote-line {
    border-left: 4px solid var(--accent-primary);
    padding-left: 12px;
    margin: 4px 0;
    color: var(--text-muted);
}

/* Mesaj resimleri */
.message-image {
    max-width: 400px;
    max-height: 300px;
    border-radius: 8px;
    margin: 8px 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

.message-image-error {
    background: var(--bg-quaternary);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: var(--text-muted);
    margin: 8px 0;
    font-size: 14px;
}

/* Discord Emoji */
.discord-emoji {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin: 0 2px;
    object-fit: contain;
}

/* Unicode Emoji */
.unicode-emoji {
    font-size: 1.2em;
    line-height: 1;
}

/* Message Reactions */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    margin-left: 56px;
}

.message-item.compact .message-reactions {
    margin-left: 56px;
}

.reaction-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-quaternary);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.reaction-emoji {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.reaction-emoji-unicode {
    font-size: 16px;
    line-height: 1;
}

.reaction-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Message Embeds */
.message-embed {
    max-width: 520px;
    margin: 8px 0 8px 56px;
    border-left: 4px solid #7c3aed;
    background: var(--bg-quaternary);
    border-radius: 4px;
    padding: 12px 16px;
}

.message-item.compact .message-embed {
    margin-left: 56px;
}

.embed-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-normal);
}

.embed-author-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.embed-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-normal);
    margin-bottom: 8px;
}

.embed-title a {
    color: #60a5fa;
    text-decoration: none;
}

.embed-title a:hover {
    text-decoration: underline;
}

.embed-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.5;
}

.embed-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.embed-field {
    min-width: 0;
}

.embed-field.inline {
    display: inline-block;
}

.embed-field-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-normal);
    margin-bottom: 4px;
}

.embed-field-value {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.embed-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    margin-top: 12px;
    cursor: pointer;
}

.embed-thumbnail {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    float: right;
    margin-left: 16px;
}

/* Message Input */
.message-input-container {
    padding: 16px;
}

.message-input-wrapper {
    background: var(--bg-quaternary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.message-plus-btn {
    background: none;
    border: none;
    color: var(--interactive-normal);
    font-size: 20px;
    cursor: pointer;
    padding: 10px 8px 10px 0;
    transition: color 0.2s;
}

.message-plus-btn:hover:not(:disabled) {
    color: var(--interactive-hover);
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-normal);
    padding: 11px 0;
    font-size: 15px;
}

.message-input:focus {
    outline: none;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.message-actions {
    display: flex;
    gap: 8px;
}

.emoji-picker-btn {
    background: none;
    border: none;
    color: var(--interactive-normal);
    font-size: 20px;
    cursor: pointer;
    padding: 10px 0 10px 8px;
    transition: color 0.2s;
}

.emoji-picker-btn:hover:not(:disabled) {
    color: var(--interactive-hover);
}

/* Üyeler Sidebar (Sağ) */
.members-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.members-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--bg-tertiary);
}

.members-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.role-category {
    padding: 8px 8px 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 16px;
}

.role-category:first-child {
    margin-top: 0;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.member-item:hover {
    background: var(--bg-quaternary);
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.member-actions {
    display: none; /* Üç nokta butonunu gizle */
}

.member-menu-btn {
    display: none; /* Üç nokta butonunu gizle */
}

/* Dropdown Menu */
.dropdown-menu-dark {
    background: var(--bg-floating);
    border: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    padding: 8px;
}

.dropdown-menu-dark .dropdown-item {
    color: var(--text-normal);
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.dropdown-menu-dark .dropdown-item:hover {
    background: var(--accent-primary);
    color: white;
}

.dropdown-menu-dark .dropdown-item i {
    margin-right: 8px;
}

/* Sağ Tık Menüsü */
.context-menu {
    position: fixed;
    background: var(--bg-floating);
    border-radius: 4px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 10000;
}

.context-menu-item {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-normal);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background: var(--accent-primary);
    color: white;
}

.context-menu-item.text-danger:hover {
    background: #dc2626;
}

.context-menu-separator {
    height: 1px;
    background: var(--bg-quaternary);
    margin: 4px 0;
}

/* No Guilds Message */
.no-guilds-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.no-guilds-message i {
    color: var(--text-muted);
}

.no-guilds-message h2 {
    color: var(--text-normal);
    margin-bottom: 8px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border: 4px solid transparent;
    background-clip: padding-box;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-quaternary);
    border: 4px solid transparent;
    background-clip: padding-box;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    min-width: 250px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Error Pages */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.error-container h1 {
    color: var(--text-normal);
}

.error-container p {
    color: var(--text-muted);
}

/* Alert */
.alert {
    color: var(--text-normal);
}

.alert-danger {
    background: #dc2626;
    border: none;
}

/* Responsive */
@media (max-width: 768px) {
    .members-sidebar {
        display: none;
    }
    
    .channels-sidebar {
        width: 240px;
    }
}
