/**
 * FCA PWA Install Widget Styles
 * Uses Fluent Community (FCOM) CSS variables for proper theming
 * Reference: docs/05-guides/ui-styling-guide.md
 */

/* ========================================
   Sidebar Widget
   ======================================== */

#fca-pwa-install-widget-sidebar.fca-pwa-widget-sidebar,
#fca-pwa-install-widget.fca-pwa-widget-sidebar {
    background: var(--fcom-light-bg, var(--fcom-secondary-bg, #f0f2f5));
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--fcom-primary-border, #DADDE1);
}

/* ========================================
   Floating Widget
   ======================================== */

#fca-pwa-install-widget-floating.fca-pwa-widget-floating,
#fca-pwa-install-widget.fca-pwa-widget-floating {
    position: fixed;
    z-index: 9998;
    background: var(--fcom-primary-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 320px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    border: 1px solid var(--fcom-primary-border, #DADDE1);
}

#fca-pwa-install-widget.fca-pwa-widget-floating.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#fca-pwa-install-widget-floating.fca-pwa-widget-bottom-right,
#fca-pwa-install-widget.fca-pwa-widget-bottom-right {
    bottom: 20px;
    right: 20px;
}

#fca-pwa-install-widget-floating.fca-pwa-widget-bottom-left,
#fca-pwa-install-widget.fca-pwa-widget-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* ========================================
   Widget Inner Layout
   ======================================== */

.fca-pwa-widget-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.fca-pwa-widget-content {
    flex: 1;
    min-width: 0;
}

.fca-pwa-widget-buttons {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* ========================================
   App Icon
   ======================================== */

.fca-pwa-widget-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.fca-pwa-widget-icon-svg {
    width: 48px;
    height: 48px;
    padding: 10px;
    background: var(--fcom-primary-button, #1877F2);
    color: var(--fcom-primary-button-text, #fff);
    border-radius: 12px;
    flex-shrink: 0;
}

/* ========================================
   Content
   ======================================== */

.fca-pwa-widget-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fcom-primary-text, #050505);
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.fca-pwa-widget-text {
    font-size: 12px;
    color: var(--fcom-secondary-text, #65676B);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fca-pwa-widget-cta {
    font-size: 13px;
    color: var(--fcom-secondary-text, #65676B);
    margin: 0;
    line-height: 1.4;
}

/* ========================================
   Buttons
   ======================================== */

.fca-pwa-widget-install-btn {
    padding: 8px 16px;
    background: var(--fcom-primary-button, #1877F2);
    color: var(--fcom-primary-button-text, #fff) !important;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: 1.4;
}

.fca-pwa-widget-install-btn:hover {
    opacity: 0.9;
}

.fca-pwa-widget-dismiss-btn {
    padding: 8px 12px;
    background: transparent;
    color: var(--fcom-secondary-text, #65676B);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.4;
}

.fca-pwa-widget-dismiss-btn:hover {
    background: var(--fcom-active-bg, #E7F3FF);
}

/* ========================================
   Mobile Responsive
   On mobile, sidebar widget becomes floating
   ======================================== */

@media (max-width: 991px) {
    /* On mobile, sidebar widget is hidden (sidebars aren't visible) */
    #fca-pwa-install-widget-sidebar.fca-pwa-widget-sidebar,
    #fca-pwa-install-widget.fca-pwa-widget-sidebar {
        display: none !important;
    }
}

/* ========================================
   iOS Instructions Modal
   ======================================== */

#fca-pwa-ios-instructions {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.fca-pwa-ios-modal {
    background: var(--fcom-primary-bg, #fff);
    padding: 24px;
    border-radius: 16px;
    max-width: 320px;
    width: 100%;
    position: relative;
    color: var(--fcom-primary-text, #050505);
    border: 1px solid var(--fcom-primary-border, #DADDE1);
    }
    
.fca-pwa-ios-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--fcom-secondary-text, #65676B);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.fca-pwa-ios-close:hover {
    color: var(--fcom-primary-text, #050505);
}

.fca-pwa-ios-modal h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    padding-right: 32px;
}

.fca-pwa-ios-modal ol {
    margin: 0;
    padding: 0 0 0 20px;
}

.fca-pwa-ios-modal li {
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 14px;
    color: var(--fcom-secondary-text, #65676B);
}

.fca-pwa-ios-modal li:last-child {
    margin-bottom: 0;
}

.fca-pwa-ios-modal strong {
    color: var(--fcom-primary-text, #050505);
}
