/* Global site styles */

/* Self-hosted Roboto font (replaces Google Fonts external request) */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/roboto-300.woff2') format('woff2'),
         url('../fonts/roboto-300.woff') format('woff');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/roboto-400.woff2') format('woff2'),
         url('../fonts/roboto-400.woff') format('woff');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/roboto-500.woff2') format('woff2'),
         url('../fonts/roboto-500.woff') format('woff');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/roboto-700.woff2') format('woff2'),
         url('../fonts/roboto-700.woff') format('woff');
}

.login-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.login-loading-text {
    color: white !important;
    font-size: 1.1rem;
}

/* App startup loading overlay */
.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F5DC;
    transition: opacity 0.25s ease;
}

.app-loading-overlay--hidden {
    opacity: 0;
    pointer-events: none;
}

.app-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #2D5016;
}

.app-loading-text {
    font-size: 1rem;
    font-weight: 500;
}

.app-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(45, 80, 22, 0.2);
    border-top-color: #2D5016;
    border-radius: 50%;
    animation: app-spin 0.8s linear infinite;
}

@keyframes app-spin {
    to { transform: rotate(360deg); }
}

/* ── AttachedFilesControl ─────────────────────────────────────────────────── */

.attached-files-drop-zone {
    border: 2px dashed var(--mud-palette-divider, #e0e0e0);
    border-radius: 8px;
    transition: border-color 0.2s, background-color 0.2s;
    background-color: var(--mud-palette-background, #fff);
}

.attached-files-drop-zone:hover {
    border-color: var(--mud-palette-primary, #594ae2);
    background-color: var(--mud-palette-primary-lighten, rgba(89,74,226,0.04));
}

.attached-files-drop-zone--active {
    border-color: var(--mud-palette-primary, #594ae2);
    background-color: var(--mud-palette-primary-lighten, rgba(89,74,226,0.08));
}

.attached-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

/* Card wrapper — position context for overlay, badge, and menu */
.attached-files-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--mud-palette-surface, #1e1e2e);
    box-shadow: 0 2px 8px rgba(0,0,0,0.20);
    transition: box-shadow 0.2s, transform 0.15s;
}

.attached-files-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.30);
    transform: translateY(-2px);
}

.attached-files-item--default {
    outline: 2px solid var(--mud-palette-primary, #594ae2);
    outline-offset: 0;
}

/* Clickable image/icon area */
.attached-files-card {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2a2a3e;
}

.attached-files-card:focus {
    outline: 2px solid var(--mud-palette-primary, #594ae2);
    outline-offset: -2px;
}

/* Full-bleed background image */
.attached-files-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attached-files-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Gradient overlay at the bottom for date + description */
.attached-files-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
}

.attached-files-overlay-date {
    color: rgba(255,255,255,0.85);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.attached-files-overlay-notes {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Star badge top-left for default image */
.attached-files-default-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.45);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffc107;
    pointer-events: none;
}

/* 3-dot menu button — floats top-right over the card */
.attached-files-menu {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    background: rgba(0,0,0,0.40);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.attached-files-item:hover .attached-files-menu,
.attached-files-item:focus-within .attached-files-menu {
    opacity: 1;
}

