/* DISCORD BENZERI - PROFESYONEL DARK THEME */

:root {
    --primary: #5865F2;
    --primary-dark: #4752C4;
    --success: #43B581;
    --danger: #F04747;
    --dark-1: #36393F;
    --dark-2: #2F3136;
    --dark-3: #282B30;
    --text-primary: #DCDDDE;
    --text-secondary: #B9BBBE;
    --text-muted: #72767D;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* PANEL */
.dm-panel {
    position: fixed;
    bottom: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: var(--dark-1);
    border-left: 1px solid rgba(79, 84, 92, 0.48);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    z-index: 950;
    transition: right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
    min-height: 0;
}

.dm-panel.open {
    right: 0;
}

/* HEADER */
.dm-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(79, 84, 92, 0.48);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--dark-1);
}

.dm-user-info {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.dm-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.dm-status-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid var(--dark-1);
    background: var(--success);
}

.dm-user-details {
    flex: 1;
    min-width: 0;
}

.dm-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.dm-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ACTIONS */
.dm-actions {
    display: flex;
    gap: 8px;
}

.dm-action-btn {
    background: rgba(79, 84, 92, 0.4);
    border: none;
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dm-action-btn:hover {
    background: rgba(79, 84, 92, 0.6);
}

/* MESSAGES CONTAINER */
.dm-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 0px;
    background: var(--dark-1);
}

.dm-messages::-webkit-scrollbar {
    width: 8px;
}

.dm-messages::-webkit-scrollbar-track {
    background: transparent;
}

.dm-messages::-webkit-scrollbar-thumb {
    background: rgba(79, 84, 92, 0.5);
    border-radius: 4px;
}

.dm-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 84, 92, 0.7);
}

/* LOADING */
.dm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--text-muted);
}

.dm-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(88, 101, 242, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* EMPTY */
.dm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
}

.dm-empty-icon {
    font-size: 48px;
    opacity: 0.3;
}

/* TIMESTAMP */
.dm-timestamp {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin: 4px 0;
    padding: 8px 0;
}

/* MESSAGE GROUP */
.dm-message-group {
    display: flex;
    gap: 8px;
    margin: 2px 0;
    align-items: flex-end;
}

.dm-message-group.dm-message-own {
    justify-content: flex-end;
    padding-right: 4px;
}

.dm-message-group.dm-message-other {
    justify-content: flex-start;
    padding-left: 4px;
}

/* MESSAGE BOX */
.dm-message {
    padding: 8px 12px;
    border-radius: 14px;
    display: inline-block;
    max-width: 65%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* OWN MESSAGE - BLUE GRADIENT */
.dm-message-group.dm-message-own .dm-message {
    background: linear-gradient(135deg, #5B65F5 0%, #4752C4 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

/* OTHER MESSAGE - DARK GRAY */
.dm-message-group.dm-message-other .dm-message {
    background: var(--dark-2) !important;
    color: var(--text-primary) !important;
}

.dm-msg-time {
    font-size: 11px;
    opacity: 0.7;
    white-space: nowrap;
    margin-left: 4px;
}

.dm-msg-status {
    font-size: 11px;
    opacity: 0.7;
    white-space: nowrap;
    margin-left: 4px;
}

/* MESSAGE MENU */
.dm-message-menu {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dm-message-group:hover .dm-message-menu {
    opacity: 1;
}

.dm-menu-btn {
    background: rgba(79, 84, 92, 0.5);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dm-menu-btn:hover {
    background: rgba(79, 84, 92, 0.8);
    color: var(--text-primary);
}

/* CONTEXT MENU */
.dm-message-context-menu {
    position: fixed;
    background: var(--dark-2);
    border: 1px solid rgba(79, 84, 92, 0.48);
    border-radius: 6px;
    padding: 4px 0;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.dm-message-context-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    text-align: left;
    transition: all 0.15s ease;
}

.dm-message-context-menu button:hover {
    background: var(--primary);
    color: white;
}

/* INPUT AREA */
.dm-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(79, 84, 92, 0.48);
    background: var(--dark-1);
}

.dm-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* ICON BUTTONS */
.dm-btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.dm-btn-icon:hover {
    background: rgba(79, 84, 92, 0.4);
    color: var(--text-primary);
}

/* INPUT FIELD */
.dm-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--dark-2);
    border: 1px solid rgba(79, 84, 92, 0.48);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.dm-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--dark-3);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

.dm-input::placeholder {
    color: var(--text-muted);
}

/* SEND BUTTON */
.dm-send-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #5B65F5 0%, #4752C4 100%);
    border: none;
    color: white;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.dm-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.dm-send-btn:active {
    transform: translateY(0);
}

/* TYPING */
.dm-typing-indicator {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 0;
    min-height: 16px;
}

/* EMOJI PICKER */
.emoji-picker-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--dark-2);
    border: 1px solid rgba(79, 84, 92, 0.48);
    border-radius: 10px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.emoji-btn:hover {
    background: var(--primary);
    transform: scale(1.2);
}

/* ERROR */
.dm-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--danger);
    text-align: center;
    padding: 20px;
}

.dm-error button {
    padding: 8px 16px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.dm-error button:hover {
    background: #e63d3d;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-info {
    background: var(--primary);
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

/* ANIMATIONS */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .dm-panel {
        width: 400px;
        right: -400px;
    }
}

@media (max-width: 768px) {
    .dm-panel {
        width: 100%;
        right: -100%;
    }
    
    .dm-message {
        max-width: 75%;
    }
}