/* שיפורים נוספים לרספונסיביות ונגישות */

/* רספונסיביות מובייל - גלילה אנכית וסרגלים אופקיים */
@media (max-width: 768px) {
    .top-logos {
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1000;
        padding: 0;
        gap: 15px;
        background: transparent;
        transform: none;
        -webkit-transform: none;
    }
    
    .logo {
        height: 45px;
        background: transparent;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .logo-sjda {
        max-width: 90px;
    }
    
    .logo-agma {
        max-width: 75px;
    }
    
    /* הסתרת טולטיפים במובייל */
    .logo-link::after,
    .logo-link::before {
        display: none;
    }
    
    /* מאפיינים נוספים ללוגואים במובייל */
    .top-logos {
        will-change: auto;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .logo-link {
        background: transparent;
        -webkit-tap-highlight-color: transparent;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
        padding: 0 1rem;
    }
    
    .hero-title .icon {
        width: 32px;
        height: 32px;
        margin-left: 10px;
    }
    
    .hero-title .icon-water::before {
        width: 20px;
        height: 20px;
        border-width: 2px;
        top: 6px;
        left: 6px;
    }
    /* סרגלים הופכים לאופקיים במובייל */
    .summary-track {
        width: 100%;
        min-width: 280px;
        overflow-x: auto;
    }
    
    .slider-container {
        min-width: 300px;
    }
    
    /* רווח אנכי מוגדל */
    .page {
        padding: 1.5rem 0;
    }
    
    .intro-section, .about-section {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }
    
    /* כפתורים במובייל */
    .action-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* תמיכה משופרת למכשירים קטנים מאוד */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}

/* שיפורים לטאבלטים */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .action-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .btn {
        min-width: 180px;
    }
    
    .format-details {
        grid-template-columns: 1fr 1fr;
    }
}

/* שיפורים למסכים רחבים */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .intro-content,
    .about-content,
    .tool-content,
    .summary-content {
        padding: 3rem;
    }
    
    .hero-section {
        padding: 5rem 0 0 0;
    }
}

/* מצב הדפסה */
@media print {
    .btn,
    .page-header button,
    .tool-navigation,
    .export-section {
        display: none !important;
    }
    
    .page {
        display: block !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #333;
    }
}

/* מצב גבוה ניגודיות */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000000;
        --text-light: #333333;
        --border-color: #000000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .tension-card {
        border-width: 2px;
    }
}

/* אנימציות מופחתות למי שמעדיף */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* שיפור נגישות עבור מקלדת */
.btn:focus,
.slider-input:focus,
.tension-header:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* שיפור לקוראי מסך */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* אינדיקטור טעינה */
.loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* הודעות מערכת */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
    color: white;
}

.notification.error {
    background: var(--danger-color);
    color: white;
}

.notification.warning {
    background: var(--warning-color);
    color: white;
}

/* שיפורים למסכי מגע */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
    
    .tension-header:hover {
        background: var(--bg-light);
    }
}

/* שיפור חוויית משתמש בסרגלים */
.slider-input::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
}

.slider-input::-webkit-slider-thumb:active {
    box-shadow: 0 0 0 12px rgba(59, 130, 246, 0.2);
}

/* סגנון מיוחד לכרטיסי מתח פעילים */
.tension-card.active {
    position: relative;
}

.tension-card.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 14px;
    z-index: -1;
    opacity: 0.3;
}

/* שיפור תצוגת טבלת תוצאות */
.results-table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.results-table {
    min-width: 600px;
}

/* אייקונים עבור סוגי תוכן */
.content-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.icon-info::before { content: 'ℹ️'; }
.icon-question::before { content: '❓'; }
.icon-check::before { content: '✅'; }
.icon-warning::before { content: '⚠️'; }

/* שיפור אנימציות */
.smooth-appear {
    animation: smoothAppear 0.6s ease-out;
}

@keyframes smoothAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* שיפור לכפתור הייצוא */
.btn.exporting {
    position: relative;
    color: transparent;
}

.btn.exporting::after {
    content: 'מייצא...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.9rem;
}