/* Color Variables */
:root {
    --primary-bg: #f9f9f9;
    --secondary-bg: #ffffff;
    --accent-color: #6e7ce0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #888888;
    --shadow-soft: 0 8px 30px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 35px rgba(0,0,0,0.1);
    --radius-small: 12px;
    --radius-medium: 16px;
    --radius-large: 20px;
    --transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Category Colors */
    --health-color: #9ed6d3;
    --beauty-color: #d8b5cc;
    --diy-color: #e0c9a7;
    
    /* Mobile Specific */
    --mobile-padding: 15px;
    --mobile-margin: 20px;
}

/* General Responsive Rules */
html, body {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    width: 100%;
    min-height: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

img {
    max-width: 100%;
    height: auto;
}

/* Medium Screens (Tablets) */
@media (max-width: 992px) {
    .home-container {
        max-width: 100%;
        padding: 0 20px;
        margin: 20px auto;
    }
    
    /* Hero Section */
    .hero-post {
        flex-direction: column;
        gap: 25px;
    }
    
    .featured-image-container, 
    .hero-content {
        width: 100%;
    }
    
    .hero-content {
        padding: 0;
    }
    
    .hero-content h2 {
        font-size: 26px;
    }
    
    /* Category & Post Grids */
    .category-highlights,
    .more-posts {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Newsletter */
    .newsletter-section {
        padding: 30px 20px;
    }
    
    .newsletter-form {
        max-width: 450px;
    }
}

/* Small Screens (Mobile) */
@media (max-width: 768px) {
  .hero-post .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }

  .hero-post .hero-actions .post-reading-time,
  .hero-post .hero-actions .save-for-later {
    width: auto !important;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: center;
  }

  .hero-section {
    overflow: visible;
  }

    .home-container {
        margin: 0 auto 15px;
        padding: 0 var(--mobile-padding);
    }
    
    /* Hero Section במובייל - עיצוב משופר */
    .hero-section {
        padding: 0;
        margin-bottom: 20px;
        border-radius: var(--radius-large);
        box-shadow: var(--shadow-soft);
        position: relative;
        overflow: hidden;
        background: var(--secondary-bg);
    }
    
    /* שיפור התמונה - תצוגה מלאה */
    .hero-section .featured-image-container {
        margin: 0;
        width: 100%;
        position: relative;
        overflow: hidden;
        box-shadow: none;
        border-radius: var(--radius-large) var(--radius-large) 0 0;
    }
    
    /* עיצוב התמונה */
    .hero-section .featured-image-container img {
        width: 100%;
        aspect-ratio: 16 / 10;
        object-fit: cover;
        border-radius: var(--radius-large) var(--radius-large) 0 0;
        transform: scale(1);
    }
    
    /* סידור תוכן ה-Hero */
    .hero-post {
        flex-direction: column;
        gap: 0;
        margin-top: 0;
    }
    
    /* תוכן הגיבור */
    .hero-content {
        padding: 20px 20px 25px;
        width: 100%;
    }
    
	/* כותרת המאמר - חדש בשיפקה */
	.hero-label {
		position: absolute;
		top: 15px;
		right: 15px;
		z-index: 5;
	}

	.hero-label .new-label {
		background-color: var(--accent-color);
		color: white;
		font-size: 15px;
		font-weight: 500;
		padding: 8px 18px;
		border-radius: 30px;
		display: inline-block;
		box-shadow: 0 2px 10px rgba(0,0,0,0.15);
	}
    
    /* עיצוב תאריך מעל הכותרת */
    .hero-date-wrapper {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-bottom: 18px;
        background-color: #f5f7ff;
        border-radius: 30px;
        padding: 10px 16px;
        width: auto;
        align-self: flex-end;
        box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    }
    
    .hero-date-wrapper i {
        color: var(--accent-color);
        margin-left: 8px;
        font-size: 16px;
    }
    
    /* כותרת */
    .hero-content h2 {
        font-size: 23px;
        font-weight: 600;
        margin: 5px 0 16px;
        line-height: 1.3;
        color: var(--text-primary);
    }
    
    .hero-content h2 a {
        color: var(--text-primary);
        text-decoration: none;
    }
    
    /* תיאור */
    .hero-content p {
        font-size: 18px;
        line-height: 1.2;
        margin-bottom: 20px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        color: var(--text-secondary);
    }
    
    /* הסתרת תגית קטגוריה */
    .hero-section .category-badge {
        display: none;
    }
    
    /* אזור פעולות */
    .hero-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(0,0,0,0.05);
    }
    
	/* זמן קריאה משופר */
	.post-reading-time {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		font-size: 14px;
		color: var(--text-secondary);
		background-color: #f5f7ff;
		padding: 8px 16px;
		border-radius: 30px;
		min-width: 110px;
		justify-content: center;
	}

    
	/* כפתור שמירה */
	.save-for-later {
		background-color: #f5f7ff;
		border: none;
		color: var(--text-secondary);
		display: flex;
		align-items: center;
		gap: 8px;
		font-size: 14px;
		padding: 8px 16px;
		border-radius: 30px;
		box-shadow: 0 2px 5px rgba(0,0,0,0.03);
	}

	.save-for-later i {
		font-size: 16px;
		color: var(--accent-color);
		margin-left: 4px;
	}

	.save-for-later span {
		display: inline-block;
		font-size: 13px;
	}
		
    .save-for-later.saved i {
        color: var(--accent-color);
    }
    
    .save-for-later:active {
        transform: scale(0.95);
    }
    
    /* Category Highlights */
    .category-highlights,
    .more-posts {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 25px;
    }
    
    .category-post {
        margin-bottom: 0;
        border-radius: var(--radius-medium);
        box-shadow: var(--shadow-soft);
        overflow: hidden;
        background: var(--secondary-bg);
    }
    
    .category-post .post-content {
        padding: 16px;
    }
    
    .category-post h3 {
        font-size: 23px;
        margin-bottom: 8px;
        font-weight: 600;
        color: var(--text-primary);
    }
		
	.category-post p {
		font-size: 18px;
		margin-bottom: 12px;
		display: block;
		overflow: visible;
		-webkit-line-clamp: unset;
		-webkit-box-orient: initial;
		color: var(--text-secondary);
	}
    
    .category-post .category-badge {
        padding: 4px 10px;
        font-size: 12px;
        border-radius: 20px;
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: 16px;
        padding: 0 5px;
    }
    
    .section-header h2 {
        font-size: 20px;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .view-all {
        font-size: 14px;
        color: var(--accent-color);
    }
    
    /* Daily Tip */
    .daily-tip {
        padding: 20px;
        margin-bottom: 25px;
        gap: 15px;
        border-radius: var(--radius-medium);
        box-shadow: var(--shadow-soft);
        background: var(--secondary-bg);
    }
    
    .daily-tip .icon-wrapper {
        width: 45px;
        height: 45px;
    }
    
    .daily-tip i {
        font-size: 20px;
    }
    
    .daily-tip h3 {
        font-size: 18px;
        margin-bottom: 8px;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .daily-tip p {
        font-size: 14px;
        line-height: 1.5;
        color: var(--text-secondary);
    }
    
    /* Load More Button */
    .load-more-wrapper {
        margin: 20px 0;
    }
    
    .load-more-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        border-radius: var(--radius-small);
        background-color: #f5f7ff;
        color: var(--text-primary);
        font-weight: 500;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .load-more-btn:active {
        background-color: #eef0f9;
        transform: scale(0.98);
    }
    
    /* Newsletter */
    .newsletter-section {
        padding: 24px 20px;
        margin: 25px 0;
        border-radius: var(--radius-medium);
        box-shadow: var(--shadow-soft);
        background: var(--secondary-bg);
    }
    
    .newsletter-section h3 {
        font-size: 19px;
        margin-bottom: 10px;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .newsletter-section p {
        font-size: 14px;
        margin-bottom: 16px;
        color: var(--text-secondary);
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .newsletter-form input {
        width: 100%;
        border-radius: var(--radius-small);
        padding: 14px 16px;
        margin-right: 0;
        border: 1px solid #ddd;
        font-size: 15px;
    }
    
    .newsletter-form button {
        width: 100%;
        margin-right: 0;
        padding: 14px 16px;
        background-color: var(--accent-color);
        color: white;
        border: none;
        border-radius: var(--radius-small);
        font-weight: 500;
    }
    
    /* Card Interactions */
    .hero-section:hover,
    .featured-image-container:hover,
    .category-post:hover,
    .read-more:hover,
    .save-for-later:hover,
    .category-badge:hover,
    .view-all:hover,
    .load-more-btn:hover {
        transform: none;
    }
    
    .featured-image-container::before,
    .featured-image-container-small a::before {
        display: none;
    }
    
    /* Native-Like Touch Feedback */
    .featured-image-container a,
    .hero-content h2 a,
    .category-post h3 a,
    .read-more,
    .save-for-later,
    .load-more-btn,
    .view-all,
    .category-badge {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
    
	/* Save For Later Button */
	.category-post .save-for-later {
		padding: 0;
	}

	.category-post .post-meta .save-for-later span {
		display: none;
	}
    
	/* Post Meta */
	.post-meta {
		font-size: 12px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 8px 0;
	}
	
    .post-date {
        gap: 3px;
        color: var(--text-light);
    }
    
    /* תאריך ושעה משופרים */
    .hero-section .post-date {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 14px;
		font-weight: 600;
        background-color: #f5f7ff;
        padding: 8px 16px;
        border-radius: 25px;
        margin: 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    }
    
    .hero-section .post-date i {
        color: var(--accent-color);
        font-size: 16px;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    .home-container {
        padding: 0 10px;
    }
    
    .hero-content h2 {
        font-size: 23px;
		line-height: 1.2;		
    }
    
	.hero-content p {
		display: block;
		overflow: visible;
		-webkit-line-clamp: unset;
		-webkit-box-orient: initial;
	}

   
    .hero-section .featured-image-container img {
        aspect-ratio: 16 / 10;
    }
    
    .hero-actions {
        flex-direction: row;
    }
    
    .category-post .post-content {
        padding: 14px;
    }
    
    .section-header h2 {
        font-size: 18px;
    }
    
    .daily-tip h3 {
        font-size: 17px;
    }
    
    .newsletter-section h3 {
        font-size: 18px;
    }
    
    /* התאמות לתצוגת זמן קריאה במסכים קטנים */
    .post-reading-time {
        font-size: 13px;
        padding: 5px 12px;
		font-weight: 600;
    }
    
    .post-reading-time i {
        font-size: 16px;
    }
}

/* Native App Usability Enhancements */
@media (max-width: 768px) {
    /* Smooth Scrolling */
    .home-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Active States for Touch */
    .read-more:active,
    .category-badge:active,
    .view-all:active {
        opacity: 0.8;
    }
    
    /* Better Touch Target Sizes */
    .post-meta .post-date,
    .save-for-later,
    .read-more,
    .category-badge {
        min-height: 40px;
    }
    
    /* Optimize Text for Mobile Reading */
    p {
        line-height: 1.5;
    }
    
    /* Active Card States */
    .category-post:active,
    .hero-section:active {
        transform: scale(0.995);
    }
    
    /* App-Style Card Design */
    .category-post,
    .hero-section,
    .daily-tip,
    .newsletter-section {
        border-radius: var(--radius-medium);
    }
    
    /* Optimize Animations & Transitions */
    .category-post,
    .hero-section,
    .daily-tip,
    .save-for-later,
    .read-more,
    .load-more-btn,
    .newsletter-form button,
    .category-badge,
    .view-all {
        transition: var(--transition);
    }
    
    /* Avoid Text Overflow */
    h2, h3, p {
        word-break: break-word;
    }
    
    /* Add bottom spacing */
    .category-highlights:last-child,
    .more-posts-section:last-child,
    .newsletter-section:last-child {
        margin-bottom: 80px;
    }
}

/* Add safe area insets for modern devices */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .home-container {
            padding-left: max(var(--mobile-padding), env(safe-area-inset-left));
            padding-right: max(var(--mobile-padding), env(safe-area-inset-right));
            padding-bottom: max(20px, env(safe-area-inset-bottom));
        }
    }
}

/* Modern Animation Effects */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulsing {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Pulse effect for save icon */
.pulsing {
    animation: pulsing 0.5s ease;
    color: var(--accent-color);
}

/* Native App Elements */
.pull-refresh-indicator,
.native-toast,
.offline-indicator,
.app-install-banner {
    direction: rtl;    
}

.app-install-banner .app-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-install-banner .app-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-install-banner .app-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.app-install-banner .app-details h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.app-install-banner .app-details p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.app-install-banner .install-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.2s ease;
}

.app-install-banner .install-btn:active {
    background-color: #5a69c9;
    transform: scale(0.95);
}

.app-install-banner .close-banner {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 8px;
    font-size: 18px;
}

/* Native App Toast Message */
.native-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1000;
    text-align: center;
    max-width: 80%;
}

/* Mobile Safari Fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS */
    .home-container {
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        min-height: -webkit-fill-available;
    }
    
    html {
        height: -webkit-fill-available;
    }
}

/* Firefox Specific Fixes */
@-moz-document url-prefix() {
    .home-container {
        scroll-behavior: auto;
    }
}

/* טיפול בכפתור שמירה בפוסטים רגילים */
.category-post .post-meta .save-for-later,
.bookmark-button {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e4f6;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
    color: var(--accent-color);
    padding: 0;
    margin: 0;
}

.category-post .post-meta .save-for-later i,
.bookmark-button i {
    font-size: 20px;
    color: var(--accent-color);
    transition: transform 0.2s ease;
}

.category-post .post-meta .save-for-later:active,
.bookmark-button:active {
    background-color: rgba(245, 247, 255, 0.95);
    transform: scale(0.92);
}

.category-post .post-meta .save-for-later:active i,
.bookmark-button:active i {
    transform: scale(0.9);
}

.category-post .post-meta .save-for-later.saved,
.bookmark-button.saved {
    background-color: rgba(245, 247, 255, 0.9);
    border-color: var(--accent-color);
}

/* מצב למכשירים גדולים יותר */
@media (min-width: 769px) {
    .category-post .post-meta .save-for-later,
    .bookmark-button {
        width: 38px;
        height: 38px;
    }
    
    .category-post .post-meta .save-for-later i,
    .bookmark-button i {
        font-size: 18px;
    }
}