/**
 * Blog Page Styles
 * Portfolio Website by Amr Farag
 * Matches home.css, portfolio.css, and resources.css design system
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    --dark: #0A0E1A;
    --dark-light: #1E2637;
    --primary: #FF9500;
    --primary-hover: #FFB340;
    --text: #FFFFFF;
    --text-light: #E5E5E5;
    --text-gray: #94A3B8;
    --border: rgba(255, 255, 255, 0.1);
    --border-primary: rgba(255, 149, 0, 0.4);
}

/* ==================== BLOG HERO SECTION ==================== */

.blog-hero-section {
    background: linear-gradient(135deg, 
        #0F1624 0%, 
        #1a2332 25%,
        #0d1520 50%,
        #1f2937 75%,
        #0F1624 100%
    );
    position: relative;
    padding: 160px 0 100px;
    overflow: hidden;
    min-height: 60vh;
}

.blog-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 149, 0, 0.08) 0%, transparent 70%);
    z-index: 1;
}

.blog-hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 149, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 149, 0, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    z-index: 1;
    opacity: 0.6;
}

.blog-hero-section .container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.blog-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: rgba(255, 149, 0, 0.06);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 149, 0, 0.4);
    border-radius: 50px;
    margin-bottom: 30px;
    box-shadow: 
        0 0 25px rgba(255, 149, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: fadeIn 0.8s ease-out;
}

.blog-badge span {
    color: #FF9500;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.blog-hero-title {
    font-size: clamp(48px, 6vw, 72px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -2px;
    color: #FFFFFF;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

.blog-hero-subtitle {
    font-size: 20px;
    line-height: 1.6;
    color: #E5E5E5;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out 0.4s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== CATEGORY FILTER SECTION ==================== */

.category-filter-section {
    background: linear-gradient(180deg, 
        rgba(15, 22, 36, 0.98) 0%, 
        rgba(20, 28, 42, 0.95) 100%
    );
    top: 70px;
    z-index: 40;
    padding: 30px 0;
    border-bottom: 2px solid rgba(255, 149, 0, 0.15);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.category-filter-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 149, 0, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.category-btn {
    padding: 16px 34px;
    background: rgba(30, 38, 55, 0.7);
    border: 2px solid rgba(255, 149, 0, 0.35);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    color: #E5E5E5;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(15px);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    outline: none;
}

/* Gradient shine effect */
.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn:hover {
    border-color: #FF9500;
    background: rgba(255, 149, 0, 0.15);
    transform: translateY(-3px);
    color: #FF9500;
    box-shadow: 
        0 10px 30px rgba(255, 149, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.category-btn.active {
    background: linear-gradient(135deg, #FF9500, #FFB340);
    border-color: #FF9500;
    color: #0A0E1A;
    box-shadow: 
        0 12px 35px rgba(255, 149, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.category-btn.active::after {
    content: '✓';
    margin-left: 4px;
    font-size: 14px;
    font-weight: 900;
}

/* ==================== BLOG POSTS SECTION ==================== */

.blog-posts-section {
    background: linear-gradient(180deg, 
        rgba(15, 22, 36, 0.95) 0%, 
        rgba(25, 32, 48, 0.98) 50%,
        rgba(15, 22, 36, 0.95) 100%
    );
    position: relative;
    padding: 120px 0;
    overflow: hidden;
}

.blog-posts-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 149, 0, 0.06) 0%, transparent 70%);
    z-index: 1;
}

.blog-posts-section .container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
}

/* ==================== BLOG CARDS GRID ==================== */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
}

.blog-card {
    background: linear-gradient(
        135deg,
        rgba(255, 149, 0, 0.05) 0%,
        rgba(30, 38, 55, 0.7) 50%,
        rgba(255, 149, 0, 0.05) 100%
    );
    border: 2px solid rgba(255, 149, 0, 0.3);
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(15px);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(255, 149, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 35px;
    height: 35px;
    border-top: 2px solid rgba(255, 149, 0, 0.4);
    border-right: 2px solid rgba(255, 149, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 2;
}

.blog-card:hover {
    border-color: #FF9500;
    background: linear-gradient(
        135deg,
        rgba(255, 149, 0, 0.08) 0%,
        rgba(30, 38, 55, 0.85) 50%,
        rgba(255, 149, 0, 0.08) 100%
    );
    transform: translateY(-8px);
    box-shadow: 
        0 20px 45px rgba(0, 0, 0, 0.5),
        0 0 45px rgba(255, 149, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.blog-card:hover::before {
    border-color: #FF9500;
}

/* ==================== BLOG CARD IMAGE ==================== */

.blog-card-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1), rgba(30, 38, 55, 0.9));
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.08);
}

/* Overlay for images */
.blog-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(10, 14, 26, 0.4) 100%
    );
    pointer-events: none;
}

/* ==================== BLOG CARD CONTENT ==================== */

.blog-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-category-badge {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(255, 149, 0, 0.15);
    border: 1px solid rgba(255, 149, 0, 0.35);
    color: #FFB340;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    margin-bottom: 18px;
    width: fit-content;
    transition: all 0.3s ease;
}

.blog-card:hover .blog-category-badge {
    background: rgba(255, 149, 0, 0.25);
    border-color: #FF9500;
    color: #FF9500;
}

.blog-card-title {
    font-size: 24px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 15px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title a {
    color: #FF9500;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94A3B8;
    margin-bottom: 18px;
    font-weight: 500;
}

.blog-card-meta i {
    color: #FF9500;
    font-size: 14px;
}

.blog-card-excerpt {
    font-size: 15px;
    line-height: 1.7;
    color: #D0D0D0;
    margin-bottom: 20px;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #FF9500;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
}

.blog-card-link i {
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-link {
    gap: 14px;
}

.blog-card:hover .blog-card-link i {
    transform: translateX(5px);
}

/* ==================== EMPTY STATE ==================== */

.empty-state {
    text-align: center;
    padding: 100px 20px;
}

.empty-icon {
    font-size: 80px;
    color: rgba(255, 149, 0, 0.3);
    margin-bottom: 30px;
    filter: drop-shadow(0 0 20px rgba(255, 149, 0, 0.3));
}

.empty-title {
    font-size: 32px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 18px;
    color: #94A3B8;
}

/* ==================== CTA SECTION ==================== */

.cta-section {
    background: linear-gradient(180deg, 
        rgba(15, 22, 36, 0.95) 0%, 
        rgba(18, 25, 38, 0.98) 50%,
        rgba(15, 22, 36, 0.95) 100%
    );
    position: relative;
    padding: 120px 0;
    overflow: hidden;
    border-top: 1px solid rgba(255, 149, 0, 0.3);
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 149, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.cta-section .container {
    position: relative;
    z-index: 1;
}
/**
 * Blog Page - Mobile Optimized Styles
 * Add this file AFTER blog.css in your HTML
 * <link rel="stylesheet" href="/blog-mobile.css">
 */

/* ==================== TABLET (768px and below) ==================== */
@media (max-width: 768px) {
    
    /* === HERO SECTION - COMPACT === */
    .blog-hero-section {
        padding: 90px 20px 50px !important;
        min-height: auto !important;
    }
    
    .blog-badge {
        padding: 8px 20px;
        margin-bottom: 20px;
    }
    
    .blog-badge span {
        font-size: 12px;
    }
    
    .blog-hero-title {
        font-size: 38px;
        margin-bottom: 16px;
    }
    
    .blog-hero-subtitle {
        font-size: 16px;
        max-width: 90%;
    }
    
    /* === BLOG GRID === */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .blog-posts-section {
        padding: 60px 20px;
    }
}

/* ==================== MOBILE (480px and below) ==================== */
@media (max-width: 480px) {
    
    /* === HERO SECTION - BETTER HEIGHT === */
    .blog-hero-section {
        padding: 80px 16px 60px !important;
        min-height: 35vh !important;
    }
    
    .blog-badge {
        padding: 10px 24px;
        margin-bottom: 24px;
    }
    
    .blog-badge span {
        font-size: 12px;
        letter-spacing: 1.5px;
    }
    
    .blog-hero-title {
        font-size: 36px !important;
        margin-bottom: 20px !important;
        letter-spacing: -0.5px;
        line-height: 1.2;
    }
    
    .blog-hero-subtitle {
        font-size: 16px !important;
        line-height: 1.6 !important;
        margin: 0 auto;
        max-width: 95%;
    }
    
    /* === CATEGORY FILTER - HIDE BUTTONS, SHOW DROPDOWN === */
    .category-filter-section {
        position: relative !important;
        top: auto !important;
        padding: 25px 16px !important;
        background: rgba(15, 22, 36, 0.98) !important;
        border-bottom: 1px solid rgba(255, 149, 0, 0.2);
    }
    
    /* Hide the button filters on mobile */
    .category-filters {
        display: none !important;
    }
    
    /* Show mobile dropdown instead */
    .category-mobile-dropdown {
        display: block !important;
        width: 100%;
    }
    
    .category-mobile-dropdown select {
        width: 100%;
        padding: 16px 20px;
        background: rgba(30, 38, 55, 0.7);
        border: 2px solid rgba(255, 149, 0, 0.35);
        border-radius: 50px;
        color: #E5E5E5;
        font-size: 15px;
        font-weight: 600;
        font-family: 'Poppins', sans-serif;
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FF9500' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 20px center;
        background-size: 18px;
        padding-right: 50px;
        backdrop-filter: blur(15px);
        box-shadow: 
            0 4px 15px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
        transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .category-mobile-dropdown select:focus {
        outline: none;
        border-color: #FF9500;
        background: rgba(255, 149, 0, 0.15);
        box-shadow: 
            0 10px 30px rgba(255, 149, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
        color: #FF9500;
    }
    
    .category-mobile-dropdown select option {
        background: rgba(30, 38, 55, 0.95);
        color: #E5E5E5;
        padding: 14px 20px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 1px solid rgba(255, 149, 0, 0.1);
    }
    
    .category-mobile-dropdown select option:hover,
    .category-mobile-dropdown select option:checked {
        background: rgba(255, 149, 0, 0.2);
        color: #FF9500;
    }
    
    /* Label for dropdown */
    .category-mobile-label {
        display: block;
        color: #FF9500;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        margin-bottom: 12px;
        text-align: center;
    }
    
    .category-mobile-label i {
        margin-right: 6px;
        font-size: 13px;
    }
    
    /* === BLOG POSTS SECTION === */
    .blog-posts-section {
        padding: 40px 16px !important;
    }
    
    .blog-posts-section .container {
        width: 100%;
        padding: 0 !important;
    }
    
    /* === BLOG CARDS === */
    .blog-grid {
        gap: 20px;
    }
    
    .blog-card {
        border-radius: 16px;
        border-width: 1.5px;
    }
    
    .blog-card::before {
        width: 25px;
        height: 25px;
        top: 12px;
        right: 12px;
    }
    
    .blog-card-image {
        height: 200px;
    }
    
    .blog-card-content {
        padding: 20px 18px !important;
    }
    
    .blog-category-badge {
        padding: 8px 16px;
        font-size: 11px;
        margin-bottom: 12px;
    }
    
    .blog-card-title {
        font-size: 20px !important;
        font-weight: 700;
        margin-bottom: 12px;
        line-height: 1.3;
    }
    
    .blog-card-meta {
        font-size: 13px;
        margin-bottom: 14px;
        color: #A8B5C7;
    }
    
    .blog-card-excerpt {
        font-size: 15px !important;
        line-height: 1.6;
        margin-bottom: 16px;
        color: #D8D8D8;
    }
    
    .blog-card-link {
        font-size: 15px;
        gap: 8px;
        padding: 10px 0;
    }
    
    /* === EMPTY STATE === */
    .empty-state {
        padding: 40px 16px;
    }
    
    .empty-icon {
        font-size: 50px;
        margin-bottom: 20px;
    }
    
    .empty-title {
        font-size: 22px;
        margin-bottom: 12px;
    }
    
    .empty-text {
        font-size: 15px;
        line-height: 1.5;
    }
    
    /* === CTA SECTION === */
    .cta-section {
        padding: 50px 16px !important;
    }
    
    .cta-section h2 {
        font-size: 26px !important;
        margin-bottom: 16px !important;
        line-height: 1.3 !important;
    }
    
    .cta-section p {
        font-size: 15px !important;
        line-height: 1.6 !important;
        margin-bottom: 30px !important;
    }
    
    .cta-section a {
        width: 100% !important;
        max-width: 280px;
        padding: 15px 35px !important;
        font-size: 15px !important;
        display: inline-flex !important;
        justify-content: center !important;
    }
}

/* ==================== EXTRA SMALL (360px and below) ==================== */
@media (max-width: 360px) {
    .blog-hero-section {
        padding: 90px 16px 50px !important;
    }
    
    .blog-hero-title {
        font-size: 32px !important;
    }
    
    .blog-hero-subtitle {
        font-size: 15px !important;
    }
    
    .blog-card-image {
        height: 180px;
    }
    
    .blog-card-title {
        font-size: 18px !important;
    }
    
    .blog-card-content {
        padding: 18px 16px !important;
    }
}

/* ==================== TOUCH DEVICE OPTIMIZATIONS ==================== */
@media (hover: none) and (pointer: coarse) {
    
    /* Disable hover effects */
    .blog-card:hover {
        transform: none;
        border-color: rgba(255, 149, 0, 0.3);
        box-shadow: 
            0 10px 35px rgba(0, 0, 0, 0.4),
            0 0 25px rgba(255, 149, 0, 0.06);
    }
    
    .blog-card:hover .blog-card-image img {
        transform: scale(1);
    }
    
    .blog-card:hover::before {
        border-color: rgba(255, 149, 0, 0.4);
    }
    
    /* Use tap/active states instead */
    .blog-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Dropdown tap feedback */
    .category-mobile-dropdown select:active {
        transform: scale(0.98);
    }
}

/* ==================== ACCESSIBILITY ==================== */

/* Focus states */
.category-mobile-dropdown select:focus-visible {
    outline: 3px solid #FF9500;
    outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card-image img,
    .category-mobile-dropdown select {
        transition: none !important;
    }
}

/* ==================== END OF MOBILE CSS ==================== */
