/* ==========================================================================
   MESSAGES & ANNOUNCEMENTS STYLES - x8 Analiz
   ========================================================================== */

/* Navbar bildirim butonları ve açılır menüleri */
.nav-notify-group {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.nav-icon-wrapper {
    position: relative;
}

.nav-icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 850;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    border: 2px solid #13232e;
}

.nav-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 750;
    transition: all 0.2s ease;
}

.nav-user-chip:hover {
    background: rgba(255, 255, 255, 0.12);
}

.nav-user-avatar {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    font-size: 11px;
    font-weight: 850;
}

/* Açılır Menü (Dropdown Card) */
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 45px -5px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
    z-index: 1050;
    overflow: hidden;
    animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-dropdown-menu.open {
    display: block;
}

@keyframes dropdownPop {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.dropdown-header-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.dropdown-header-left h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 850;
    color: #0f172a;
}

.dropdown-header-left span {
    font-size: 12px;
    color: #64748b;
}

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

.dropdown-action-write {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0284c7;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.dropdown-action-write:hover {
    text-decoration: underline;
}

.dropdown-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 9999px;
    background: #059669;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.15s;
}

.dropdown-action-btn:hover {
    background: #047857;
}

.dropdown-action-link {
    color: #059669;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.dropdown-action-link:hover {
    text-decoration: underline;
}

.dropdown-body {
    max-height: 380px;
    overflow-y: auto;
    padding: 4px 0;
}

/* Duyuru satırı */
.dropdown-announcement-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.15s ease;
}

.dropdown-announcement-row:hover {
    background: #f8fafc;
}

.announcement-icon-box {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #10b981;
    font-size: 16px;
    font-weight: 850;
    flex-shrink: 0;
}

.announcement-icon-box.unread {
    background: #fef2f2;
    color: #ef4444;
}

.announcement-row-info {
    flex: 1;
    min-width: 0;
}

.announcement-row-title {
    display: block;
    font-size: 12px;
    font-weight: 850;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.announcement-row-date {
    display: block;
    font-size: 11px;
    color: #64748b;
}

/* Mesaj satırı */
.dropdown-message-row {
    display: block;
    padding: 12px 18px;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    position: relative;
}

.dropdown-message-row:hover {
    background: #f8fafc;
}

.dropdown-msg-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.dropdown-msg-sender {
    font-size: 12px;
    font-weight: 850;
    color: #059669;
}

.dropdown-msg-date {
    font-size: 11px;
    color: #64748b;
}

.dropdown-msg-subject {
    font-size: 13px;
    font-weight: 850;
    color: #0f172a;
    margin-bottom: 3px;
}

.dropdown-msg-snippet {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-empty {
    padding: 24px 18px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* ==========================================================================
   MESAJLARIM SAYFASI (.messages-workspace)
   ========================================================================== */
.messages-page {
    width: min(1320px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 54px;
}

.messages-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.messages-hero h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 850;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-compose-modal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
    transition: all 0.2s ease;
}

.btn-compose-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4);
}

.messages-split-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    align-items: start;
}

/* Sol sütun: Mesaj Listesi */
.threads-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.threads-card-head {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    font-weight: 850;
    color: #64748b;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.threads-list {
    display: flex;
    flex-direction: column;
}

.thread-card-item {
    display: block;
    padding: 16px 18px;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.15s ease;
    position: relative;
}

.thread-card-item:hover {
    background: #f8fafc;
}

.thread-card-item.active {
    background: #ecfdf5 !important;
    border-left: 4px solid #10b981 !important;
}

.thread-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.thread-card-sender {
    font-size: 13px;
    font-weight: 850;
    color: #059669;
}

.thread-card-date {
    font-size: 11px;
    color: #64748b;
}

.thread-card-subject {
    font-size: 14px;
    font-weight: 850;
    color: #0f172a;
    margin-bottom: 4px;
}

.thread-card-snippet {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.unread-pip {
    position: absolute;
    top: 18px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

/* Sağ sütun: Konuşma Detayı & Yanıt */
.conversation-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 26px 30px;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05);
}

.conv-head {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.conv-subject-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 21px;
    font-weight: 850;
    color: #0f172a;
    margin: 0 0 10px;
}

.conv-meta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
    color: #64748b;
}

.conv-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.conv-meta-row strong {
    color: #0f172a;
    font-weight: 750;
}

/* Mesaj Balonu (Ana Mesaj) */
.message-box-main {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #f97316;
    border-radius: 12px;
    padding: 22px 24px;
    font-size: 14px;
    line-height: 1.75;
    color: #1e293b;
    white-space: pre-line;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.message-box-attachment {
    margin-top: 14px;
}

.message-box-attachment img {
    max-width: 100%;
    max-height: 350px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

/* Yanıt Balonları */
.replies-stream {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.reply-item-bubble {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #10b981;
    border-radius: 12px;
    padding: 18px 22px;
    font-size: 14px;
    line-height: 1.65;
    color: #1e293b;
    white-space: pre-line;
}

.reply-item-bubble.admin-reply {
    background: #eff6ff;
    border-color: #bfdbfe;
    border-left-color: #3b82f6;
}

.reply-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
    color: #64748b;
}

.reply-item-meta strong {
    color: #0f172a;
    font-weight: 800;
}

/* Yanıt Formu */
.reply-composer {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #f1f5f9;
}

.reply-composer h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 850;
    color: #0f172a;
}

.reply-composer textarea {
    width: 100%;
    min-height: 110px;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    color: #0f172a;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    background: #ffffff;
}

.reply-composer textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.reply-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.btn-attach-image {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px dashed #6ee7b7;
    background: #ecfdf5;
    color: #059669;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-attach-image:hover {
    background: #d1fae5;
}

.btn-send-reply {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border: 0;
    border-radius: 10px;
    background: #059669;
    color: #ffffff;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    transition: all 0.2s ease;
}

.btn-send-reply:hover {
    background: #047857;
    transform: translateY(-1px);
}

/* Yeni Mesaj Modalı */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    place-items: center;
    padding: 20px;
}

.modal-backdrop.open {
    display: grid;
}

.modal-card {
    width: min(560px, 100%);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 850;
    color: #0f172a;
}

.modal-close-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 0;
    background: #f1f5f9;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.modal-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    font-family: inherit;
    outline: none;
    background: #ffffff;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.btn-modal-cancel {
    padding: 10px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.btn-modal-submit {
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: #0284c7;
    color: #ffffff;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

/* ==========================================================================
   DUYURULAR SAYFASI (.announcements-page)
   ========================================================================== */
.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.announcement-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.announcement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.09);
}

.announcement-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.announcement-badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    background: #ecfdf5;
    color: #059669;
}

.announcement-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 850;
    color: #0f172a;
}

.announcement-card p {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
}

.announcement-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: #94a3b8;
}

@media (max-width: 900px) {
    .messages-split-grid {
        grid-template-columns: 1fr;
    }
    .nav-dropdown-menu {
        position: fixed;
        top: 72px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}
