/**
 * Modul: media_chat/css/attach_modal.css
 * Zweck: Zentrales, dunkles Messenger-Design fuer das einheitliche "Datei senden"-Modal (#attach_file_modal)
 *        fuer alle drei Dateitypen (Bild / Foto, PDF, Video) inkl. Kachel-Auswahl, Medien-Vorschau,
 *        optionaler Video-Notiz und Upload-Fortschrittsbalken.
 * Nicht zustaendig fuer: Chat-Blasen der User-Videos (`media_chat/css/user_video.css`).
 * Zusammenspiel: Eingebunden in `header.inc.php` sowie inline in `attach_file.php` (100 % Cache-/OPcache-sicher).
 */

#attach_file_modal.mc-attach-modal-open {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    background: rgba(6, 9, 14, 0.74) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    overflow-y: auto !important;
    z-index: 1055 !important;
}

#attach_file_modal .modal-dialog {
    width: 100% !important;
    max-width: 460px !important;
    min-height: 0 !important;
    margin: auto !important;
}

#attach_file_modal .mc-attach-modal-content,
.mc-uvideo-modal-content {
    --bs-modal-bg: #1d2433;
    --bs-modal-color: #f8fafc;
    background: linear-gradient(165deg, #232b3b 0%, #181e2b 100%) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 20px !important;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
    overflow: hidden;
}

#attach_file_modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 15px 18px !important;
    background: rgba(255, 255, 255, 0.02);
}

#attach_file_modal .modal-body {
    padding: 18px !important;
}

#attach_file_modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 12px 18px !important;
    background: rgba(0, 0, 0, 0.18) !important;
}

#attach_file_modal .material-symbols-outlined {
    font-size: 24px !important;
    line-height: 1 !important;
}

#attach_file_modal #select_file #select_file_pdf .material-symbols-outlined {
    transform: none !important;
}

#select_file_pdf,
#select_file_image,
#select_file_video {
    display: block !important;
    position: static !important;
}

#select_file_pdf input[type="file"],
#select_file_image input[type="file"],
#select_file_video input[type="file"] {
    display: none !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    opacity: 1 !important;
}

.mc-attach-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#attach_file_modal .mc-attach-header-icon .material-symbols-outlined {
    font-size: 18px !important;
}

#attach_file_modal .mc-attach-tile {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    margin: 0;
    text-decoration: none;
    width: 100%;
    min-height: 128px;
    padding: 14px 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

#attach_file_modal .mc-attach-tile:hover,
#attach_file_modal .mc-attach-tile:focus-visible {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.11) !important;
    border-color: var(--v8-primary, #38b138) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    outline: none;
}

#attach_file_modal .mc-attach-tile-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#attach_file_modal .mc-attach-tile-icon .material-symbols-outlined {
    font-size: 26px !important;
}

.mc-attach-tile-icon--image {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.35);
}

.mc-attach-tile-icon--pdf {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.mc-attach-tile-icon--video {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.35);
}

.mc-attach-tile-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.2;
}

#attach_file_modal .mc-attach-tile-price {
    font-size: 0.72rem;
    font-weight: 600;
    color: #dce4f2 !important;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    padding: 2px 9px;
    margin-top: 1px;
    white-space: nowrap;
}

.mc-attach-picker-hint {
    font-size: 0.76rem;
    color: #c7d0e0;
    text-align: center;
    margin-top: 13px;
}

.mc-attach-preview-box {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 15px;
    padding: 12px;
}

.mc-attach-preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.mc-attach-preview-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    white-space: nowrap;
}

.mc-attach-preview-filebar {
    margin-bottom: 10px;
}

.mc-attach-preview-filename {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.3;
}

.mc-attach-preview-meta {
    font-size: 0.74rem;
    color: #b8c4d9 !important;
    line-height: 1.35;
    margin-top: 1px;
}

.mc-attach-img-frame,
.mc-attach-video-frame {
    background: #0b0f17;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mc-attach-img-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 250px;
}

#mcAttachImgPreview {
    display: block;
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.mc-attach-video-frame video {
    display: block;
    width: 100%;
    max-height: 220px;
    background: #000000;
}

.mc-attach-video-fallback {
    padding: 16px 12px;
    font-size: 0.78rem;
    line-height: 1.42;
    color: rgba(255, 255, 255, 0.86);
    text-align: center;
}

.mc-attach-pdf-card {
    background: rgba(11, 15, 23, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    overflow: hidden;
}

.mc-attach-pdf-frame-wrap {
    background: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#mcAttachPdfFrame {
    width: 100%;
    height: 205px;
    border: 0;
    display: block;
    background: #ffffff;
}

.mc-attach-pdf-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
}

.mc-attach-caption-wrap {
    margin-top: 10px;
}

.mc-attach-caption-label {
    display: block;
    font-size: 0.75rem;
    color: #c7d0e0;
    margin-bottom: 4px;
}

.mc-attach-caption-input {
    font-size: 16px !important; /* iOS Safari: verhindert Auto-Zoom beim Tippen */
    background: rgba(255, 255, 255, 0.09) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    padding: 7px 11px !important;
}

.mc-attach-caption-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.mc-attach-caption-input:focus {
    border-color: var(--v8-primary, #38b138) !important;
    box-shadow: none !important;
}

.mc-attach-confirm-hint {
    font-size: 0.74rem;
    line-height: 1.38;
    color: #c7d0e0;
    margin-top: 8px;
}

.mc-attach-progress-wrap {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mc-attach-progress-bar {
    background-color: var(--v8-primary, #38b138) !important;
    transition: width 0.2s ease;
}

.mc-attach-btn-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.24) !important;
    color: #f1f5f9 !important;
    font-weight: 600;
    white-space: nowrap;
}

.mc-attach-btn-secondary:hover,
.mc-attach-btn-secondary:focus {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.42) !important;
    color: #ffffff !important;
}

.mc-attach-btn-primary {
    background: var(--v8-primary, #38b138) !important;
    color: var(--mc-brand-contrast, #ffffff) !important;
    border: 1px solid transparent !important;
    font-weight: 700;
    white-space: nowrap;
}

.mc-attach-btn-primary:hover,
.mc-attach-btn-primary:focus {
    background: var(--v8-primary, #38b138) !important;
    color: var(--mc-brand-contrast, #ffffff) !important;
    filter: brightness(1.08);
}

.mc-attach-btn-primary:disabled,
.mc-attach-btn-primary.disabled {
    --bs-btn-disabled-bg: rgba(255, 255, 255, 0.11);
    --bs-btn-disabled-color: rgba(255, 255, 255, 0.6);
    --bs-btn-disabled-border-color: rgba(255, 255, 255, 0.18);
    --bs-btn-disabled-opacity: 1;
    background: rgba(255, 255, 255, 0.11) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    opacity: 1 !important;
    cursor: not-allowed;
}

#attach_file_modal #file_sent {
    color: #f8fafc;
    font-size: 0.96rem;
    text-align: center;
    padding: 16px 8px;
}

.mc-attach-sent-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

#attach_file_modal .mc-attach-sent-icon .material-symbols-outlined {
    font-size: 30px !important;
}
