/* ===================================================
   AVERON - TAM YENİ TEMA
   Baştan sona yeniden yazılmış
   =================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ===== ANA RENKLER ===== */
:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --bg-dark: #1a1a2e;
    --bg-light: #16213e;
    --accent: #0f3460;
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --border-color: #2d3561;
    --success: #2ecc71;
    --danger: #e74c3c;
}

/* ===== AUTH MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: var(--bg-dark);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    padding: 0;
    border: 1px solid var(--border-color);
    animation: modalEnter 0.4s ease-out;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-container {
    padding: 50px 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.tagline {
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 300;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-light);
    font-weight: 600;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-gray);
}

.form-group small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-gray);
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-gray);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.form-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    width: 100%;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 20px;
    padding: 8px 12px;
    transition: all 0.2s;
    border-radius: 8px;
}

.btn-icon:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.1);
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 13px;
    animation: slideIn 0.3s ease-out;
}

.alert-error {
    background: rgba(231, 76, 60, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.alert-success {
    background: rgba(46, 204, 113, 0.15);
    color: #51cf66;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.alert.hidden {
    display: none !important;
}

/* ===== MAIN APP ===== */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
}

.main-app {
    display: flex !important;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
}

.main-app.hidden {
    display: none !important;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 80px;
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--accent) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 20px;
}

.user-profile {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.user-profile:hover {
    border-radius: 30%;
    transform: scale(1.05);
}

.user-profile img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: none;
}

.servers-list {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.server-item {
    width: 50px;
    height: 50px;
    background: var(--accent);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-light);
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.server-item:hover {
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    transform: scale(1.05);
}

.server-item.active {
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-left: 4px solid var(--success);
}

.add-btn {
    background: var(--accent);
    color: var(--success);
    font-size: 28px;
    font-weight: bold;
}

.add-btn:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.sidebar-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

/* ===== CHANNELS PANEL ===== */
.channels-panel {
    width: 260px;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
}

.channels-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channels-header h3 {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 600;
}

.channels-list {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.channel-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-gray);
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.channel-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    padding-left: 20px;
}

.channel-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 13px;
}

.direct-messages {
    padding: 20px 12px;
    border-top: 1px solid var(--border-color);
}

.direct-messages h4 {
    font-size: 12px;
    color: var(--text-gray);
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.dm-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ===== CHAT AREA ===== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    min-width: 0;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-type {
    color: var(--text-gray);
    font-size: 18px;
}

.chat-title h2 {
    font-size: 18px;
    color: var(--text-light);
    font-weight: 600;
}

.chat-actions {
    display: flex;
    gap: 16px;
}

/* ===== MESSAGES ===== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 14px;
    margin-bottom: 4px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.message:hover {
    background: rgba(255, 255, 255, 0.05);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 6px;
}

.message-author {
    font-weight: 600;
    color: var(--text-light);
    font-size: 14px;
}

.message-timestamp {
    font-size: 12px;
    color: var(--text-gray);
}

.message-text {
    color: var(--text-light);
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 14px;
}

.loading {
    text-align: center;
    color: var(--text-gray);
    padding: 30px;
    font-size: 14px;
}

.loading-spinner {
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MESSAGE INPUT ===== */
.message-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--accent);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-light);
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

.message-input::placeholder {
    color: var(--text-gray);
}

/* ===== USER PANEL ===== */
.user-panel {
    width: 260px;
    background: var(--bg-light);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.user-panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-panel-header h3 {
    font-size: 14px;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.users-list {
    flex: 1;
    padding: 12px;
}

.user-item {
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-gray);
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
}

.user-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    flex-shrink: 0;
}

.user-item-name {
    flex: 1;
    font-weight: 500;
}

.user-item-role {
    font-size: 11px;
    color: var(--text-gray);
    text-transform: uppercase;
}

.status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
}

.status.away {
    background: #f39c12;
}

.status.offline {
    background: var(--text-gray);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}