/* styles/style.css */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #0f172a;
    color: #e5e7eb;
    min-height: 100vh;
}

/* ----------------------------------- */
/* HEADER + NAVIGATION */
/* ----------------------------------- */

.mtf-header {
    background: linear-gradient(90deg, #020617, #0b1220);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    position: sticky;
    top: 0;
    z-index: 50;
}

.mtf-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mtf-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mtf-logo-icon {
    font-size: 1.8rem;
    background: radial-gradient(circle, #22d3ee, #0ea5e9);
    border-radius: 0.6rem;
    padding: 0.35rem 0.45rem;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.6);
}

.mtf-logo-text {
    display: flex;
    flex-direction: column;
}

.mtf-logo-main {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 1.1rem;
}

.mtf-logo-sub {
    font-size: 0.75rem;
    color: #9ca3af;
}

.mtf-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.mtf-nav a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.mtf-nav a:hover {
    border-color: rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
}

/* ----------------------------------- */
/* MAIN LAYOUT */
/* ----------------------------------- */

.mtf-main {
    max-width: 1100px;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem 3rem;
}

.mtf-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding: 1rem;
    text-align: center;
    color: #9ca3af;
    background: #020617;
}

/* ----------------------------------- */
/* CARD ELEMENTS */
/* ----------------------------------- */

.mtf-card {
    background: radial-gradient(circle at top left, rgba(15, 118, 110, 0.4), #020617);
    border-radius: 1rem;
    padding: 1.2rem 1.4rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

.mtf-card.alt {
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.4), #020617);
}

.mtf-card h1,
.mtf-card h2,
.mtf-card h3 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.mtf-card p {
    margin-bottom: 0.5rem;
    color: #cbd5f5;
    font-size: 0.95rem;
}

.mtf-grid {
    display: grid;
    grid-template-columns: 2.1fr 1.2fr;
    gap: 1.5rem;
}

/* ----------------------------------- */
/* BUTTONS */
/* ----------------------------------- */

.mtf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #22c55e, #14b8a6);
    color: #020617;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.mtf-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
}

.mtf-btn.secondary {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.mtf-btn.secondary:hover {
    background: rgba(15, 23, 42, 0.9);
}

/* ----------------------------------- */
/* FORMS */
/* ----------------------------------- */

.mtf-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mtf-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.mtf-field label {
    font-size: 0.85rem;
    color: #cbd5f5;
}

.mtf-input,
.mtf-select,
.mtf-textarea {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 0.6rem;
    padding: 0.6rem 0.75rem;
    color: #e5e7eb;
    font-size: 0.9rem;
}

.mtf-input:focus,
.mtf-select:focus,
.mtf-textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

.mtf-textarea {
    resize: vertical;
    min-height: 130px;
}

.mtf-form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* ----------------------------------- */
/* ALERTS */
/* ----------------------------------- */

.mtf-alert {
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.mtf-alert.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.7);
    color: #fecaca;
}

.mtf-alert.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.7);
    color: #bbf7d0;
}

/* ----------------------------------- */
/* TABLES (Inbox & Lists) */
/* ----------------------------------- */

.mtf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
    margin-top: 0.4rem;
}

.mtf-table thead {
    background: rgba(15, 23, 42, 0.9);
}

.mtf-table th,
.mtf-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.7);
}

.mtf-table tbody tr {
    cursor: pointer;
    transition: background 0.12s ease;
}

.mtf-table tbody tr:hover {
    background: rgba(30, 64, 175, 0.45);
}

/* ----------------------------------- */
/* BADGES */
/* ----------------------------------- */

.mtf-badge {
    display: inline-flex;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
}

/* Blocked user badge */
.mtf-badge.blocked {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.7);
}

/* ----------------------------------- */
/* EMAIL VIEW */
/* ----------------------------------- */

.mtf-email-meta {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 0.7rem;
}

.mtf-email-body {
    background: rgba(15, 23, 42, 0.9);
    padding: 0.75rem 0.9rem;
    border-radius: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ----------------------------------- */
/* ADDRESS BOOK LIST */
/* ----------------------------------- */

.mtf-abook-list {
    margin-top: 0.5rem;
}

.mtf-abook-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.7rem;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(30, 64, 175, 0.6);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

/* ----------------------------------- */
/* FLOATING ADDRESS BOOK (compose.php) */
/* ----------------------------------- */

.mtf-compose-card {
    position: relative;
}

/* Base floating panel */
.mtf-abook-floating {
    position: fixed;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 240px;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 0.9rem;
    border: 1px solid rgba(59, 130, 246, 0.8);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 60;
}

/* Add scroll AFTER 5 entries (JS toggles this class) */
.mtf-abook-floating.scrollable {
    max-height: 70vh;
}

.mtf-abook-floating.scrollable .mtf-abook-body {
    overflow-y: auto;
}

/* Header */
.mtf-abook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
    font-size: 0.85rem;
    font-weight: 600;
    color: #e5e7eb;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.7), rgba(14, 116, 144, 0.9));
}

.mtf-abook-hide {
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
}

/* Contact list */
.mtf-abook-body {
    padding: 0.4rem 0.35rem;
}

.mtf-abook-contact {
    width: 100%;
    text-align: left;
    border-radius: 0.55rem;
    border: 1px solid transparent;
    padding: 0.4rem 0.45rem;
    margin-bottom: 0.25rem;
    background: rgba(15, 23, 42, 0.9);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

.mtf-abook-contact:hover {
    background: rgba(30, 64, 175, 0.8);
    border-color: rgba(129, 140, 248, 0.9);
    transform: translateY(-1px);
}

.mtf-abook-contact-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.mtf-abook-contact-email {
    font-size: 0.8rem;
    color: #a5b4fc;
}

/* Toggle icon when panel is hidden */
.mtf-abook-toggle-icon {
    position: fixed;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 55;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.9);
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.95), rgba(15, 23, 42, 0.95));
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.9);
}

.mtf-hidden {
    display: none !important;
}

/* ----------------------------------- */
/* RESPONSIVE */
/* ----------------------------------- */

@media (max-width: 800px) {
    .mtf-abook-floating {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        transform: none;
        width: 220px;
    }

    .mtf-abook-floating.scrollable {
        max-height: 40vh;
    }

    .mtf-abook-toggle-icon {
        bottom: 1rem;
        top: auto;
        transform: none;
    }

    .mtf-grid {
        grid-template-columns: 1fr;
    }

    .mtf-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* ----------------------------------- */
/* FLOATING TOAST NOTIFICATION (index) */
/* ----------------------------------- */

.mtf-toast {
    position: fixed;
    top: 1.1rem;
    right: 1.2rem;
    width: min(320px, calc(100% - 2.5rem));
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.45), #020617);
    border-radius: 0.9rem;
    border: 1px solid rgba(129, 140, 248, 0.85);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.98);
    overflow: hidden;
    z-index: 70;
    animation: mtf-toast-in 0.22s ease-out;
}

.mtf-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.9), rgba(14, 116, 144, 0.95));
    color: #e5e7eb;
}

.mtf-toast-close {
    background: transparent;
    border: none;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.1rem 0.3rem;
    border-radius: 999px;
    transition: background 0.15s ease;
}

.mtf-toast-close:hover {
    background: rgba(15, 23, 42, 0.35);
}

.mtf-toast-body {
    padding: 0.7rem 0.8rem 0.4rem;
    font-size: 0.85rem;
    color: #e5e7eb;
}

.mtf-toast-mainline {
    margin-bottom: 0.25rem;
}

.mtf-toast-subline {
    font-size: 0.8rem;
    color: #c7d2fe;
}

.mtf-toast-subject {
    font-style: italic;
}

.mtf-toast-actions {
    padding: 0.35rem 0.8rem 0.7rem;
    display: flex;
    justify-content: flex-end;
}

/* Simple slide-down animation */
@keyframes mtf-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 800px) {
    .mtf-toast {
        top: 0.8rem;
        right: 0.8rem;
        width: calc(100% - 1.6rem);
    }
}

/* ----------------------------------- */
/* ANNOUNCEMENT BANNER (index) */
/* ----------------------------------- */

.mtf-announcement-banner {
    max-width: 1100px;
    margin: 1rem auto 0.75rem;
    padding: 0 1rem;
}

.mtf-announcement-inner {
    border-radius: 0.9rem;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.35), rgba(8, 47, 73, 0.95));
    border: 1px solid rgba(96, 165, 250, 0.9);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
    padding: 0.6rem 0.85rem;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.86rem;
    color: #e5e7eb;
}

.mtf-announcement-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(147, 197, 253, 0.9);
    color: #bfdbfe;
    flex-shrink: 0;
}

.mtf-announcement-text {
    white-space: pre-wrap;
}
