/**
 * PWA Install Prompt Styles
 * Custom UI für PWA Installation
 */

/* ========================================
   Bottom Banner (Mobile)
   ======================================== */

.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color, #142030) 0%, var(--accent, #4a90e2) 100%);
    color: white;
    padding: 16px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.pwa-install-banner--visible {
    transform: translateY(0);
}

.pwa-install-banner__content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-install-banner__icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.pwa-install-banner__text {
    flex: 1;
    min-width: 0;
}

.pwa-install-banner__text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.pwa-install-banner__text span {
    display: block;
    font-size: 13px;
    opacity: 0.9;
}

.pwa-install-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-banner__install-btn {
    background: white;
    color: var(--primary-color, #142030);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pwa-install-banner__install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pwa-install-banner__install-btn:active {
    transform: scale(0.98);
}

.pwa-install-banner__close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.pwa-install-banner__close-btn:hover {
    opacity: 1;
}

/* Mobile Optimierung */
@media (max-width: 480px) {
    .pwa-install-banner__text span {
        display: none; /* Subtext verstecken auf sehr kleinen Screens */
    }
    
    .pwa-install-banner__install-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ========================================
   Dashboard Card (Desktop)
   ======================================== */

.pwa-install-card {
    background: linear-gradient(135deg, var(--background, #faf8f5) 0%, var(--primary-color, #f1e0cc) 100%);
    border: 2px solid var(--accent, #8b6f47);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.pwa-install-card--visible {
    opacity: 1;
    transform: translateY(0);
}

.pwa-install-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.pwa-install-card__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-color, #2d2419);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.pwa-install-card__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.pwa-install-card__icon {
    margin-bottom: 20px;
}

.pwa-install-card__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color, #2d2419);
    margin: 0 0 12px 0;
}

.pwa-install-card__description {
    font-size: 16px;
    color: var(--text-color, #2d2419);
    opacity: 0.8;
    margin: 0 0 16px 0;
}

.pwa-install-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.pwa-install-card__features li {
    font-size: 15px;
    color: var(--text-color, #2d2419);
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-install-card__install-btn {
    background: linear-gradient(135deg, var(--accent, #4a90e2) 0%, #142030 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    width: 100%;
}

.pwa-install-card__install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.pwa-install-card__install-btn:active {
    transform: translateY(0);
}

.pwa-install-card__note {
    font-size: 13px;
    color: var(--text-color, #2d2419);
    opacity: 0.6;
    margin: 12px 0 0 0;
    text-align: center;
}

/* ========================================
   Manual Instructions Modal
   ======================================== */

.pwa-manual-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pwa-manual-modal__content {
    background: var(--background, #faf8f5);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-manual-instructions h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color, #2d2419);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-manual-instructions ol {
    padding-left: 24px;
    margin: 0 0 24px 0;
}

.pwa-manual-instructions li {
    font-size: 16px;
    color: var(--text-color, #2d2419);
    margin-bottom: 12px;
    line-height: 1.6;
}

.pwa-manual-instructions li strong {
    font-weight: 600;
    color: var(--accent, #4a90e2);
}

.pwa-manual-modal__close {
    background: linear-gradient(135deg, var(--accent, #4a90e2) 0%, #142030 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.pwa-manual-modal__close:hover {
    transform: scale(1.02);
}

.pwa-manual-modal__close:active {
    transform: scale(0.98);
}

/* ========================================
   Dark Mode Support
   ======================================== */

[data-theme="dark"] .pwa-install-banner {
    background: linear-gradient(135deg, #142030 0%, #4a90e2 100%);
}

[data-theme="dark"] .pwa-install-banner__install-btn {
    background: #e0e0e0;
    color: #142030;
}

[data-theme="dark"] .pwa-install-card {
    background: linear-gradient(135deg, #0d1117 0%, #142030 100%);
    border-color: #4a90e2;
}

[data-theme="dark"] .pwa-install-card__title,
[data-theme="dark"] .pwa-install-card__description,
[data-theme="dark"] .pwa-install-card__features li,
[data-theme="dark"] .pwa-install-card__note {
    color: #e0e0e0;
}

[data-theme="dark"] .pwa-install-card__close {
    color: #e0e0e0;
}

[data-theme="dark"] .pwa-install-card__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .pwa-manual-modal__content {
    background: #0d1117;
}

[data-theme="dark"] .pwa-manual-instructions h3,
[data-theme="dark"] .pwa-manual-instructions li {
    color: #e0e0e0;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .pwa-install-card {
        padding: 24px;
    }
    
    .pwa-install-card__title {
        font-size: 20px;
    }
    
    .pwa-install-card__features li {
        font-size: 14px;
    }
    
    .pwa-manual-modal__content {
        padding: 24px;
    }
    
    .pwa-manual-instructions h3 {
        font-size: 18px;
    }
    
    .pwa-manual-instructions li {
        font-size: 14px;
    }
}

/* ========================================
   Enhanced iOS Instructions
   ======================================== */

.pwa-manual-instructions__header {
    text-align: center;
    margin-bottom: 24px;
}

.pwa-manual-instructions__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.pwa-manual-instructions__header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color, #2d2419);
    margin: 0;
    line-height: 1.4;
}

[data-theme="dark"] .pwa-manual-instructions__header h3 {
    color: #e0e0e0;
}

.pwa-manual-instructions__steps {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.pwa-manual-instructions__steps li {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 12px;
    border-left: 4px solid var(--accent, #4a90e2);
}

[data-theme="dark"] .pwa-manual-instructions__steps li {
    background: rgba(74, 144, 226, 0.1);
}

.pwa-manual-instructions__steps li:last-child {
    margin-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent, #4a90e2) 0%, #142030 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color, #2d2419);
    margin-bottom: 4px;
}

[data-theme="dark"] .step-content strong {
    color: #e0e0e0;
}

.step-content p {
    font-size: 14px;
    color: var(--text-color, #2d2419);
    opacity: 0.7;
    margin: 4px 0 0 0;
}

[data-theme="dark"] .step-content p {
    color: #e0e0e0;
}

.step-icon {
    font-size: 24px;
    display: inline-block;
    margin-left: 8px;
}

.pwa-manual-instructions__tip {
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1) 0%, rgba(74, 144, 226, 0.1) 100%);
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-color, #2d2419);
    border: 1px solid rgba(74, 144, 226, 0.2);
}

[data-theme="dark"] .pwa-manual-instructions__tip {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.15) 0%, rgba(20, 32, 48, 0.3) 100%);
    color: #e0e0e0;
}

.pwa-manual-instructions__tip strong {
    font-weight: 600;
}

/* iOS-specific Banner Styles */
.pwa-install-banner--ios {
    background: linear-gradient(135deg, #000000 0%, #434343 100%);
}

.pwa-install-banner--ios .pwa-install-banner__text span {
    font-size: 12px;
    max-width: 180px;
    display: block;
    line-height: 1.3;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .pwa-install-banner,
    .pwa-install-card,
    .pwa-manual-modal {
        transition: none;
        animation: none;
    }
}
