/* ئەسڵێ دیمەنێ ڕەش و زێڕین */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #000000; /* ڕەشێ قەترانی */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    overflow: hidden;
    position: relative;
}

.bg-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 10%, rgba(212, 175, 55, 0.08), transparent 50%);
    z-index: 1;
}

.app-container {
    position: relative;
    width: 100%;
    max-width: 460px;
    height: 90vh;
    display: flex;
    z-index: 2;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    background: #050505;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

/* سەرپەرشتیا سەرەکی */
.chat-header {
    padding: 16px 20px;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle-btn, .close-menu-btn {
    background: transparent;
    border: none;
    color: #ffd700;
    font-size: 1.3rem;
    cursor: pointer;
}

.ai-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffd700;
}

.chat-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ffffff, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.model-badge {
    background: rgba(212, 175, 55, 0.1);
    color: #ffd700;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* پشکا چاتی و سکرۆل */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #020202;
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}

/* ستایلێ نامان */
.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    position: relative;
    group: hover;
}

.user-wrapper { align-self: flex-start; }
.ai-wrapper { align-self: flex-end; }

.message {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.user-message {
    background: #111111;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.ai-message {
    background: rgba(212, 175, 55, 0.05);
    color: #f5f5f5;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-bottom-right-radius: 4px;
}

/* کەرەستێن میدیایێ د ناڤ نامێ دا */
.message-media {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    margin-bottom: 5px;
    object-fit: cover;
}

.message-file {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 8px;
    color: #ffd700;
    text-decoration: none;
    font-size: 0.85rem;
}

/* دوگمەیێن کارپێکرنێ ل سەر نامێ (کۆپی و دەستکاری) */
.msg-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    opacity: 0.6;
    transition: 0.2s;
}

.msg-actions button {
    background: transparent;
    border: none;
    color: #a0a0a0;
    cursor: pointer;
    font-size: 0.8rem;
}

.msg-actions button:hover {
    color: #ffd700;
}

/* بەشێ نڤیسینێ و بەستنێ */
.chat-input-area {
    padding: 16px;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.action-btn {
    color: #ffd700;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

.input-wrapper {
    flex: 1;
}

.chat-input-area input[type="text"] {
    width: 100%;
    background: #121212;
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    outline: none;
}

.chat-input-area input[type="text"]:focus {
    border-color: #ffd700;
}

/* دوگمەیا زێڕین یا نایاب */
#sendBtn {
    background: linear-gradient(45deg, #bf953f, #fcf6ba, #b38728, #fbf5b7);
    color: #000;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

/* پۆپئەپ پەیج و مێنیو */
.sidebar {
    position: absolute;
    top: 0;
    right: -100%;
    width: 270px;
    height: 100%;
    background: #080808;
    z-index: 10;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    transition: right 0.3s ease;
}

.sidebar.open { right: 0; }

.new-chat-btn {
    margin: 15px;
    background: transparent;
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.sidebar-links a {
    color: #ccc;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-links a.active, .sidebar-links a:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #ffd700;
}

.menu-overlay-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #020202;
    z-index: 5;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.menu-overlay-page.active { transform: translateY(0); }

.back-to-chat {
    background: transparent;
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.page-content {
    margin-top: 30px;
    text-align: center;
}

.page-icon { font-size: 3rem; color: #ffd700; margin-bottom: 15px; }

.db-actions-box {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.db-danger-btn {
    background: #111;
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.db-danger-btn:hover {
    background: #ff4444;
    color: #000;
}

.preview-container {
    padding: 10px;
    background: #0e0e0e;
    display: flex;
    gap: 10px;
    overflow-x: auto;
}
