/**
 * עיצוב באנר הסכמת עוגיות - GDPR
 * תואם RTL, Responsive, נגיש - גרסה מינימליסטית
 */

.cookie-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    z-index: 999999;
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    animation: slideUp 0.4s ease-out;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.cookie-banner-hiding {
    animation: slideDown 0.3s ease-in forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(120%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(120%) scale(0.95);
        opacity: 0;
    }
}

.cookie-banner-content {
    padding: 20px;
}

.cookie-banner-header {
    margin-bottom: 12px;
}

.cookie-banner-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cookie-banner-body {
    margin-bottom: 16px;
}

.cookie-banner-text {
    margin: 0 0 12px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

.cookie-categories {
    display: none; /* מוסתר בברירת מחדל - יופיע בלחיצה על "הגדרות" */
    gap: 8px;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.cookie-categories.expanded {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
}

.cookie-category {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.cookie-category:hover {
    background: #f0f2f5;
    border-color: #d0d0d0;
}

.cookie-category-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0;
}

.cookie-category-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.cookie-category-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-category-name {
    flex: 1;
    font-size: 13px;
}

.cookie-category-required {
    font-size: 11px;
    color: #888;
    font-weight: normal;
}

.cookie-category-desc {
    display: none; /* הסבר מוסתר בגרסה המינימליסטית */
    margin: 0;
    padding-right: 24px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.cookie-banner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.cookie-advanced-actions {
    margin-top: 12px;
}

.cookie-btn {
    /* Match site-wide button sizing and feel (maps to .btn) */
    padding: 12px 18px;
    min-width: 120px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cookie-btn-primary {
    /* Primary uses site gradient when possible */
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.35);
}

.cookie-btn-primary:active {
    transform: translateY(0);
}

.cookie-btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}

.cookie-btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.35);
}

.cookie-btn-secondary:active {
    transform: translateY(0);
}

.cookie-btn-text {
    background: transparent;
    color: #666;
    padding: 10px 14px;
    border: 1px solid #ddd;
    font-size: 13px;
}

.cookie-btn-text:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.cookie-btn:focus {
    outline: 2px solid rgba(76, 175, 80, 0.5);
    outline-offset: 2px;
}

.cookie-banner-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #999;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;
    justify-content: center; /* center the footer links */
}

/* Wider layout for categories: two columns on larger screens */
@media (min-width: 720px) {
    .cookie-categories.expanded {
        grid-template-columns: 1fr 1fr;
    }

    .cookie-banner {
        max-width: 640px;
    }
}

.cookie-link {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.2s;
}

.cookie-link:hover {
    color: #1976D2;
    text-decoration: underline;
}

.cookie-link:focus {
    outline: 2px solid #2196F3;
    outline-offset: 1px;
    border-radius: 2px;
}

.cookie-separator {
    color: #ddd;
}

/* Responsive - מובייל */
@media (max-width: 768px) {
    .cookie-banner {
        bottom: 12px;
        left: 12px;
        right: 12px;
        max-width: 100%;
    }
    
    .cookie-banner-content {
        padding: 16px;
    }
    
    .cookie-banner-header h3 {
        font-size: 15px;
    }
    
    .cookie-banner-text {
        font-size: 12px;
    }
    
    .cookie-categories {
        gap: 6px;
    }
    
    .cookie-category {
        padding: 6px 10px;
    }
    
    .cookie-category-label {
        font-size: 12px;
    }
    
    .cookie-banner-actions {
        gap: 6px;
    }
    
    .cookie-btn {
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .cookie-banner-footer {
        font-size: 10px;
        padding-top: 10px;
        margin-top: 10px;
    }
}

/* גרסה קומפקטית למובייל קטן */
@media (max-width: 480px) {
    .cookie-banner {
        bottom: 8px;
        left: 8px;
        right: 8px;
        border-radius: 12px;
    }
    
    .cookie-banner-content {
        padding: 14px;
    }
    
    .cookie-banner-header h3 {
        font-size: 14px;
    }
    
    .cookie-banner-text {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .cookie-btn {
        font-size: 11px;
        padding: 9px 12px;
    }
    
    .cookie-btn-text {
        padding: 8px 10px;
    }
}

/* מצב כהה (אופציונלי) */
@media (prefers-color-scheme: dark) {
    .cookie-banner {
        background: rgba(30, 30, 30, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    }
    
    .cookie-banner-header h3 {
        color: #ffffff;
    }
    
    .cookie-banner-text {
        color: #d0d0d0;
    }
    
    .cookie-category {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .cookie-category:hover {
        background: #333333;
        border-color: #444444;
    }
    
    .cookie-category-label {
        color: #e0e0e0;
    }
    
    .cookie-btn-text {
        color: #d0d0d0;
        border-color: #444;
    }
    
    .cookie-btn-text:hover {
        background: #333;
        color: #fff;
        border-color: #555;
    }
    
    .cookie-banner-footer {
        color: #888;
        border-top-color: #333;
    }
}

/* נגישות - High Contrast */
/* removed @media (prefers-contrast: high) due to inconsistent browser support;
   keep the forced-colors fallback below for high-contrast environments */

/* נגישות - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner {
        animation: none;
    }
    
    .cookie-banner-hiding {
        animation: none;
    }
    
    .cookie-btn:hover {
        transform: none;
    }
    
    * {
        transition: none !important;
    }
}

/* Print - הסתר באנר בהדפסה */
@media print {
    .cookie-banner {
        display: none !important;
    }
}
