/* Google-like Dark Attachment Viewer */
.g-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(18, 19, 23, 0.96);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    color: #f1f3f4;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    animation: gViewerFadeIn 0.2s ease-out;
}

@keyframes gViewerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.g-viewer-header {
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
    flex-shrink: 0;
}

.g-viewer-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 60%;
}

.g-viewer-title {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f1f3f4;
}

.g-viewer-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
    text-transform: uppercase;
    font-weight: 600;
}

.g-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.g-viewer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #f1f3f4;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.g-viewer-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.g-viewer-close-btn {
    background: transparent;
    border: none;
    color: #e0e0e0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    margin-left: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.g-viewer-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.g-viewer-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px;
    overflow: hidden;
}

.g-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #aaa;
    font-size: 14px;
}

.g-viewer-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: gViewerSpin 0.8s linear infinite;
}

@keyframes gViewerSpin {
    to { transform: rotate(360deg); }
}

.g-viewer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.g-viewer-content img {
    max-width: 92vw;
    max-height: calc(100vh - 90px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    user-select: none;
}

.g-viewer-content iframe {
    width: 90vw;
    height: calc(100vh - 90px);
    border: none;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.g-viewer-fallback {
    text-align: center;
    padding: 30px;
    background: rgba(30, 32, 38, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    max-width: 450px;
}
