/* Guides Page Styles */

/* תיקון בעיית הגלילה האופקית במובייל */
@media (max-width: 768px) {
    html {
        overflow-x: hidden !important;
        overscroll-behavior-x: none;
    }

    body {
        overflow-x: hidden !important;
        overscroll-behavior-x: none;
        touch-action: pan-y pinch-zoom;
    }

    .page-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: #1d1d1f;
    font-weight: 600;
    font-size: 15px;
    background: rgba(0, 122, 255, 0.08);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #007aff;
    color: white;
    transform: translateY(-2px);
}

.nav-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.logo-link {
    text-decoration: none;
}

/* Guides Main */
.guides-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Section */
.guides-hero {
    position: relative;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 40px;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 24px;
    animation: fadeInDown 0.6s ease;
}

.badge-icon {
    font-size: 18px;
}

.hero-title {
    font-size: 52px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto 32px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* Search Box in Hero */
.guides-search-container {
    max-width: 500px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.guides-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.guides-search-input {
    width: 100%;
    padding: 18px 56px 18px 24px;
    border: none;
    border-radius: 20px;
    font-size: 17px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-align: right;
}

.guides-search-input:focus {
    outline: none;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.guides-search-wrapper .search-icon {
    position: absolute;
    right: 20px;
    width: 22px;
    height: 22px;
    color: #8e8e93;
    stroke-width: 2.5;
}

/* Animated Background Shapes */
.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: 10%;
    animation-delay: -5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: -50px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, 20px) rotate(90deg); }
    50% { transform: translate(0, 40px) rotate(180deg); }
    75% { transform: translate(-20px, 20px) rotate(270deg); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category Tabs */
.category-section {
    margin-bottom: 40px;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border: 2px solid rgba(142, 142, 147, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #1d1d1f;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.category-tab:hover {
    border-color: #007aff;
    background: rgba(0, 122, 255, 0.05);
    transform: translateY(-2px);
}

.category-tab.active {
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3);
}

.tab-icon {
    font-size: 18px;
}

/* Guides Grid */
.guides-container {
    padding: 20px 0;
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

/* Guide Card */
.guide-card {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.5s ease both;
}

.guide-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.guide-card.hidden {
    display: none;
}

.guide-card-header {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* ברירת מחדל */
}

.guide-card-header.beginner {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.guide-card-header.materials {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.guide-card-header.settings {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.guide-card-header.troubleshoot {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.guide-card-header.tips {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.guide-icon {
    font-size: 80px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.guide-category-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.guide-card-body {
    padding: 24px;
    padding-left: 28px; /* מרווח נוסף לחץ שלא יחתך */
}

.guide-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 10px;
    line-height: 1.3;
}

.guide-description {
    font-size: 15px;
    color: #8e8e93;
    line-height: 1.6;
    margin-bottom: 16px;
}

.guide-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.guide-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #8e8e93;
}

.guide-time-icon {
    font-size: 14px;
}

.guide-difficulty {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.guide-difficulty.easy {
    color: #34c759;
}

.guide-difficulty.medium {
    color: #ff9500;
}

.guide-difficulty.hard {
    color: #ff3b30;
}

.guide-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 50%;
    color: #007aff;
    transition: all 0.3s ease;
}

.guide-card:hover .guide-arrow {
    background: #007aff;
    color: white;
    transform: scale(1.1);
}

/* Empty State */
.guides-empty {
    text-align: center;
    padding: 80px 20px;
}

.guides-empty .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.guides-empty h3 {
    font-size: 24px;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.guides-empty p {
    font-size: 16px;
    color: #8e8e93;
}

/* Newsletter Section */
.newsletter-section {
    margin: 60px 0;
    padding: 60px 40px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
    border-radius: 30px;
    text-align: center;
}

.newsletter-content {
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.newsletter-section h3 {
    font-size: 26px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.newsletter-section p {
    font-size: 16px;
    color: #8e8e93;
    margin-bottom: 28px;
}

.newsletter-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.newsletter-buttons .social-btn {
    padding: 14px 28px;
}

/* Modal for Guide Content */
.guide-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.guide-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.guide-modal-content {
    background: white;
    border-radius: 24px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    position: relative;
    padding: 40px;
    text-align: center;
}

.modal-header.beginner { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.modal-header.materials { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.modal-header.settings { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.modal-header.troubleshoot { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.modal-header.tips { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }

.modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.modal-icon {
    font-size: 72px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.modal-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 40px;
}

.modal-body h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 16px;
    margin-top: 28px;
}

.modal-body h2:first-child {
    margin-top: 0;
}

.modal-body p {
    font-size: 16px;
    color: #48484a;
    line-height: 1.8;
    margin-bottom: 16px;
}

.modal-body ul, .modal-body ol {
    margin: 16px 0;
    padding-right: 24px;
}

.modal-body li {
    font-size: 16px;
    color: #48484a;
    line-height: 1.8;
    margin-bottom: 10px;
}

.modal-body .tip-box {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    border-right: 4px solid #ffc107;
}

.modal-body .tip-box h4 {
    font-size: 16px;
    font-weight: 700;
    color: #856404;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body .tip-box p {
    color: #856404;
    margin: 0;
}

.modal-body .warning-box {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    border-right: 4px solid #e53e3e;
}

.modal-body .warning-box h4 {
    font-size: 16px;
    font-weight: 700;
    color: #c53030;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body .warning-box p {
    color: #c53030;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .guides-hero {
        padding: 50px 20px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 17px;
    }

    .category-tabs {
        gap: 8px;
    }

    .category-tab {
        padding: 12px 18px;
        font-size: 14px;
    }

    .tab-text {
        display: none;
    }

    .tab-icon {
        font-size: 22px;
    }

    .guides-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .guide-modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
    }

    .modal-header {
        padding: 30px 20px;
    }

    .modal-title {
        font-size: 24px;
    }

    .modal-body {
        padding: 24px;
    }

    .newsletter-section {
        padding: 40px 20px;
        margin: 40px 0;
    }

    .newsletter-section h3 {
        font-size: 22px;
    }

    .header-content {
        flex-direction: row;
        gap: 12px;
        padding: 14px 16px;
        min-height: 85px;
        align-items: center;
        justify-content: space-between;
    }

    .logo-section {
        flex-direction: row;
        text-align: right;
        align-items: center;
        gap: 12px;
    }

    .logo-image {
        width: 60px !important;
        height: 60px !important;
        border-radius: 14px;
    }

    .logo {
        font-size: 22px !important;
    }

    .logo-subtitle {
        font-size: 11px;
    }

    .header-nav {
        display: flex !important;
    }

    .header-nav .nav-link {
        padding: 10px 18px;
        font-size: 14px;
        background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
        color: white;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .guides-search-input {
        padding: 16px 50px 16px 20px;
        font-size: 16px;
    }

    .newsletter-buttons {
        flex-direction: column;
    }

    .newsletter-buttons .social-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
    }
}
