/**
 * PWA Status CSS - ClubManager v1.4.5.2
 */

body.offline::before {
    content: '⚠️ Offline - funcționalitate limitată';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    text-align: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.offline {
    padding-top: 40px !important;
}

body.offline form button[type="submit"],
body.offline form input[type="submit"] {
    opacity: 0.5;
    cursor: not-allowed;
}

body.form-dirty form {
    border-left: 3px solid #f59e0b;
}

@media (display-mode: standalone) {
    body {
        min-height: 100dvh;
        padding-top: env(safe-area-inset-top);
    }
    .cm-parent-bottom-nav {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

.cm-pwa-notice {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: min(680px, calc(100% - 32px));
    background: var(--theme-surface, #ffffff);
    color: var(--theme-text, #0f172a);
    padding: 14px 16px;
    border: 1px solid var(--theme-border, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.32);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 10020;
    font-size: 14px;
}

.cm-pwa-notice-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.cm-pwa-notice-copy strong { font-size: 15px; }
.cm-pwa-notice-copy span { color: var(--theme-text-muted, #64748b); line-height: 1.4; }
.cm-pwa-notice-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cm-pwa-notice button {
    border: 0;
    padding: 8px 13px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}
.cm-pwa-notice-primary {
    background: var(--theme-accent, #2563eb);
    color: var(--theme-accent-contrast, #ffffff);
}
.cm-pwa-notice-primary:hover { background: var(--theme-accent-hover, #1d4ed8); }
.cm-pwa-notice-secondary {
    background: var(--theme-surface-2, #f8fafc);
    color: var(--theme-text, #0f172a);
}

[data-pwa-install-action][hidden],
html.cm-pwa-installed [data-pwa-install-action] {
    display: none !important;
}

.cm-login-install {
    width: 100%;
    margin-top: 20px;
    padding: 14px 12px 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
    background: transparent;
    color: #374151;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}
.cm-login-install:not([hidden]) { display: flex; }
.cm-login-install:hover { color: #1d4ed8; }
.cm-login-install-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
}
.cm-login-install-copy { display: grid; gap: 2px; }
.cm-login-install-copy strong { font-size: 14px; line-height: 1.25; }
.cm-login-install-copy span { color: #6b7280; font-size: 12px; line-height: 1.35; }

#pwa-toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pwa-toast {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 320px;
}

.pwa-toast-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.pwa-toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.pwa-toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.pwa-toast-info { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }

@media (max-width: 640px) {
    body.offline::before { font-size: 12px; padding: 6px 12px; }
    body.offline { padding-top: 32px !important; }
    .cm-pwa-notice { flex-direction: column; align-items: stretch; }
    .cm-pwa-notice-actions { width: 100%; }
    .cm-pwa-notice-actions button { flex: 1; }
}
