/* ============================================
   BLOG PAGE STYLES
   ============================================ */

/* Note: Common styles (variables.css, base.css, components.css) 
   are loaded separately in HTML for better performance */

        /* Blog Hero Section */
        .blog-hero {
            padding: 120px 0 50px 0;
            margin-top: 0;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            text-align: center;
        }

        .blog-hero h1 {
            font-size: 56px;
            font-weight: 800;
            margin-bottom: 15px;
        }

        .blog-hero p {
            font-size: 20px;
            opacity: 0.9;
            max-width: 700px;
            margin: 0 auto;
        }

        /* Blog Grid & Cards */
        .blog-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 30px;
            margin-bottom: 60px;
        }

        .blog-card {
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: var(--transition);
            border: 1px solid var(--light-gray);
        }

        .blog-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 30px rgba(114, 108, 230, 0.15);
        }

        .blog-card-image {
            height: 200px;
            overflow: hidden;
            position: relative;
        }

        .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.05);
        }

        .blog-card-content {
            padding: 30px;
        }

        .blog-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            font-size: 14px;
        }

        .blog-date {
            color: var(--primary);
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .blog-card h3 {
            font-size: 20px;
            margin-bottom: 15px;
            line-height: 1.4;
            color: var(--dark);
        }

        .blog-card h3 a {
            color: inherit;
            text-decoration: none;
            transition: var(--transition);
        }

        .blog-card h3 a:hover {
            color: var(--primary);
        }

        .blog-excerpt {
            color: var(--gray);
            margin-bottom: 20px;
            line-height: 1.6;
        }

        .blog-read-more {
            color: var(--primary);
            font-weight: 600;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: var(--transition);
        }

        .blog-read-more:hover {
            gap: 12px;
        }

        /* Blog Controls */
        .blog-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 40px;
            gap: 20px;
        }

        .search-box {
            flex: 1;
            max-width: 400px;
            position: relative;
            order: 2;
        }

        #categorySelect {
            order: 1;
        }

        #filterSelect {
            order: 3;
        }

        .search-box input {
            width: 100%;
            padding: 12px 20px 12px 45px;
            border: 2px solid var(--light-gray);
            border-radius: 8px;
            font-size: 16px;
            transition: var(--transition);
        }

        .search-box input:focus {
            outline: 3px solid var(--primary);
            outline-offset: 2px;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(114, 108, 230, 0.1);
        }

        .search-box i {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
        }

        .filter-select {
            padding: 12px 20px;
            border: 2px solid var(--light-gray);
            border-radius: 8px;
            font-size: 16px;
            background: white;
            cursor: pointer;
            min-width: 160px;
        }

        /* Loading States */
        .loading-state {
            text-align: center;
            padding: 80px 0;
        }

        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 3px solid var(--light-gray);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .empty-state {
            text-align: center;
            padding: 80px 0;
            color: var(--gray);
        }

        .empty-state i {
            font-size: 48px;
            margin-bottom: 20px;
            color: var(--light-gray);
        }

        /* Article Modal */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 2000;
            overflow-y: auto;
            padding: 20px;
        }

        .modal-content {
            background: var(--light);
            border-radius: 12px;
            max-width: 900px;
            margin: 40px auto;
            position: relative;
            animation: modalFade 0.3s ease;
        }

        @keyframes modalFade {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .modal-close {
            position: absolute;
            top: 20px;
            right: 20px;
            background: white;
            border: 2px solid var(--light-gray);
            border-radius: 50%;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 24px;
            z-index: 10;
            transition: var(--transition);
        }

        .modal-close:hover {
            background: var(--light-gray);
        }

        /* Article Content Styles */
        .article-header {
            padding: 50px 50px 30px;
        }

        .article-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            font-size: 16px;
        }

        .article-date {
            color: var(--primary);
            font-weight: 600;
            display: flex;
            align-items: center;
			margin-bottom: 15px;
            gap: 10px;
        }

        .article-title {
            font-size: 42px;
            font-weight: 800;
            line-height: 1.2;
            color: var(--dark);
        }

		.featured-image {
			margin: 0 0 10px 0;
			padding: 10px;
			display: inline-flex;
			justify-content: center;
			align-items: center;
			max-width: 100%;
		}

		.featured-image img {
			max-width: 100%;
			height: auto;
			border-radius: 8px;
			box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
		}

        .article-body {
            padding: 0 50px 50px;
            font-size: 18px;
            line-height: 1.8;
        }

        .article-body h2 {
            font-size: 32px;
            margin: 40px 0 20px;
            color: var(--dark);
        }

        .article-body h3 {
            font-size: 24px;
            margin: 30px 0 15px;
            color: var(--dark);
        }

        .article-body p {
            margin-bottom: 20px;
        }

        /* Article image styles - keep original aspect ratio with padding */
        .article-body img:not(.featured-image img) {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
            margin: 30px 0;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            padding: 20px;
            background-color: #fff;
            border: 1px solid var(--light-gray);
            box-sizing: content-box;
            display: block;
        }

        /* Image styles inside modal */
        .modal-content .article-body img:not(.featured-image img) {
            max-width: 100%;
            height: auto;
            margin: 30px 0;
            padding: 20px;
            background-color: #fff;
            border: 1px solid var(--light-gray);
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            display: block;
            box-sizing: content-box;
        }

        .article-body ul,
        .article-body ol {
            margin: 20px 0;
            padding-left: 30px;
        }

        .article-body li {
            margin-bottom: 10px;
        }

        .article-body blockquote {
            border-left: 4px solid var(--primary);
            padding-left: 20px;
            margin: 30px 0;
            font-style: italic;
            color: var(--gray);
        }

        .article-body figure {
            margin: 30px 0;
            text-align: center;
        }

        .article-body figure img {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
            padding: 20px;
            background-color: #fff;
            border: 1px solid var(--light-gray);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            margin: 0;
            box-sizing: content-box;
        }

        .article-body figcaption {
            margin-top: 10px;
            font-style: italic;
            color: var(--gray);
            font-size: 14px;
            padding: 0 20px;
        }

        /* Article link styles */
        .article-body a {
            color: var(--primary);
            text-decoration: none;
            border-bottom: 1px solid transparent;
            transition: var(--transition);
        }

        .article-body a:hover {
            color: var(--primary-dark);
            border-bottom-color: var(--primary);
        }

        /* Social Sharing */
        .social-sharing {
            display: flex;
            gap: 15px;
            margin: 40px 0;
            padding: 25px;
            background: var(--light-gray);
            border-radius: 12px;
            align-items: center;
        }

        .share-label {
            font-weight: 600;
            color: var(--dark);
        }

        .share-buttons {
            display: flex;
            gap: 10px;
        }

        .share-btn {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            text-decoration: none;
            transition: var(--transition);
        }

        .share-btn:hover {
            transform: translateY(-3px);
        }

        .share-facebook { background: #3b5998; }
        .share-twitter { background: #1da1f2; }
        .share-linkedin { background: #0077b5; }
        .share-email { background: var(--gray); }

        /* Similar Articles */
        .similar-articles {
            margin-top: 60px;
            padding-top: 40px;
            border-top: 2px solid var(--light-gray);
            text-align: center; /* Center align the section */
        }

        .similar-articles h3 {
            font-size: 24px;
            margin-bottom: 30px;
            color: var(--dark);
        }

        .similar-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 20px;
        }

        .similar-card {
            background: white;
            border: 1px solid var(--light-gray);
            border-radius: 8px;
            padding: 20px;
            transition: var(--transition);
        }

        .similar-card:hover {
            border-color: var(--primary);
            transform: translateY(-5px);
        }

        .similar-card h4 {
            font-size: 16px;
            margin-bottom: 10px;
            color: var(--dark);
        }

        .similar-card a {
            color: inherit;
            text-decoration: none;
        }

        /* Button Styles */
        .btn {
            display: inline-block;
            padding: 16px 36px;
            background: var(--primary);
            color: white;
            border-radius: 8px;
            text-decoration: none;
            transition: var(--transition);
            border: none;
            cursor: pointer;
            font-size: 16px;
            box-shadow: 0 4px 15px rgba(114, 108, 230, 0.25);
            font-weight: 700;
        }

        .btn:hover {
            background: var(--primary-dark);
            transform: translateY(-3px);
            box-shadow: 0 10px 25px rgba(114, 108, 230, 0.3);
        }

        .btn-secondary {
            background: transparent;
            color: var(--primary);
            border: 2px solid var(--primary);
        }

        .btn-secondary:hover {
            background: rgba(114, 108, 230, 0.05);
        }

        /* Footer */
        footer {
            background: var(--dark);
            color: white;
            padding: 60px 0 40px;
        }

        .footer-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 32px;
            margin-bottom: 48px;
        }

        .footer-col h3 {
            font-size: 18px;
            margin-bottom: 12px;
            position: relative;
            padding-bottom: 10px;
            font-weight: 600;
        }

        .footer-col h3::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 50px;
            height: 3px;
            background: var(--primary);
        }

        .footer-links {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 10px;
        }
        
        .footer-links a {
            font-size: 15px;
        }

        .footer-links a {
            color: #a0aec0;
            text-decoration: none;
            transition: var(--transition);
        }

        .footer-links a:hover {
            color: white;
            padding-left: 5px;
        }

        .footer-contact li {
            display: flex;
            margin-bottom: 12px;
            align-items: flex-start;
            font-size: 15px;
        }

        .footer-contact i {
            margin-right: 10px;
            min-width: 20px;
            color: var(--primary);
        }

        .social-links {
            display: flex;
            gap: 15px;
            margin-top: 20px;
        }

        .social-links a {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            color: white;
            text-decoration: none;
        }

        .social-links a:hover {
            background: var(--primary);
            transform: translateY(-5px);
        }

        .copyright {
            text-align: center;
            padding-top: 32px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: #a0aec0;
            font-size: 14px;
            line-height: 1.5;
        }

        /* Animation Classes */
        .fade-in-up {
            opacity: 0;
            transform: translateY(30px);
        }

        .animated {
            opacity: 1;
            transform: translateY(0);
            transition: all 0.8s ease;
        }

        .card-3d {
            transition: transform 0.5s ease, box-shadow 0.5s ease;
        }

        .card-3d:hover {
            transform: translateY(-10px) rotateX(2deg) rotateY(2deg);
            box-shadow: 0 25px 50px rgba(114, 108, 230, 0.15);
        }

        /* iOS-specific fixes */
        @supports (-webkit-touch-callout: none) {
            body {
                -webkit-overflow-scrolling: touch;
            }
            
            .btn:hover {
                transform: none;
            }
            
            .card-3d:hover {
                transform: none;
            }
        }

        /* Responsive Design */
        @media (max-width: 1200px) {
            .section-title h1 {
                font-size: 42px;
            }
            
            .blog-hero h1 {
                font-size: 48px;
            }
        }

        @media (max-width: 992px) {
            .blog-hero {
                padding: 100px 0 40px 0;
            }
            
            .blog-hero h1 {
                font-size: 42px;
            }
            
            .article-title {
                font-size: 36px;
            }
            
            .featured-image {
                height: 300px;
            }
            
            .article-header,
            .article-body {
                padding-left: 40px;
                padding-right: 40px;
            }
            
            .article-body img:not(.featured-image img),
            .modal-content .article-body img:not(.featured-image img),
            .article-body figure img {
                padding: 15px;
                margin: 20px 0;
            }
            
            .article-body figcaption {
                padding: 0 15px;
            }
        }

        @media (max-width: 800px) {
            .nav-links {
                position: fixed;
                top: 70px;
                left: 0;
                background: white;
                width: 100%;
                flex-direction: column;
                align-items: center;
                padding: 20px 0;
                box-shadow: 0 10px 10px rgba(0, 0, 0, 0.05);
                transform: translateY(-150%);
                transition: var(--transition);
            }
            
            .nav-links.active {
                transform: translateY(0);
            }
            
            .nav-links li {
                margin: 15px 0;
            }
            
            .mobile-menu-btn {
                display: block;
                margin-left: auto;
                order: 2;
            }
            
            .blog-hero h1 {
                font-size: 36px;
            }
            
            .blog-controls {
                flex-direction: column;
                align-items: stretch;
            }
            
            .search-box {
                max-width: 100%;
            }
            
            .article-title {
                font-size: 32px;
            }
            
            .article-header,
            .article-body {
                padding: 30px;
            }
            
            .modal-content {
                margin: 20px auto;
            }
            
            .article-body img:not(.featured-image img),
            .modal-content .article-body img:not(.featured-image img),
            .article-body figure img {
                padding: 12px;
                margin: 15px 0;
            }
        }

        @media (max-width: 768px) {
            .blog-grid {
                grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
                gap: 20px;
            }
            
            .article-meta {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }
            
            .social-sharing {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .share-buttons {
                flex-wrap: wrap;
            }
            
            /* Footer Mobile Optimization */
            .footer-grid {
                grid-template-columns: 1fr;
                text-align: center;
                gap: 30px;
            }
            
            .footer-col {
                justify-self: center;
            }
            
            .footer-col h3::after {
                display: none;
            }
            
            .footer-col h3 {
                margin-bottom: 0;
                padding-bottom: 0;
            }
            
            .footer-contact,
            .footer-links {
                margin-top: 0 !important;
                line-height: 1.1 !important;
            }
            
            .footer-links li {
                margin-bottom: 4px !important;
            }
            
            .footer-links a {
                line-height: 1.1 !important;
            }
            
            .social-links {
                justify-content: center;
            }
        }

        @media (max-width: 576px) {
            main {
                padding-top: 80px;
            }
            
            .content-section {
                padding: 60px 0;
            }
            
            .section-title h1 {
                font-size: 32px;
            }
            
            .blog-hero {
                padding: 90px 0 30px 0;
            }
            
            .blog-hero h1 {
                font-size: 32px;
            }
            
            .blog-hero p {
                font-size: 16px;
            }
            
            .blog-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }
            
            .blog-card-content {
                padding: 20px;
            }
            
            .article-title {
                font-size: 28px;
            }
            
            .featured-image {
                height: 250px;
            }
            
            .article-body h2 {
                font-size: 24px;
            }
            
            .article-body h3 {
                font-size: 20px;
            }
            
            .article-body img:not(.featured-image img),
            .modal-content .article-body img:not(.featured-image img),
            .article-body figure img {
                padding: 10px;
                margin: 15px 0;
            }
            
            .article-body figcaption {
                padding: 0 10px;
                font-size: 13px;
            }
        }

        @media (max-width: 480px) {
            .section-title h1 {
                font-size: 28px;
            }
            
            .section-title p {
                font-size: 16px;
            }
            
            .blog-card h3 {
                font-size: 18px;
            }
            
            .article-title {
                font-size: 24px;
            }
            
            .featured-image {
                height: 200px;
            }
            
            .article-header,
            .article-body {
                padding: 20px;
            }
            
            .article-body img:not(.featured-image img),
            .modal-content .article-body img:not(.featured-image img),
            .article-body figure img {
                padding: 8px;
                margin: 10px 0;
            }
            
            .article-body figcaption {
                padding: 0 8px;
            }
        }

        @media (max-width: 320px) {
            body {
                font-size: 14px;
            }
            
            .container {
                padding: 0 12px;
            }
            
            .blog-card-content {
                padding: 15px;
            }
            
            .article-header,
            .article-body {
                padding: 15px;
            }
            
            .article-body img:not(.featured-image img),
            .modal-content .article-body img:not(.featured-image img),
            .article-body figure img {
                padding: 6px;
                margin: 8px 0;
            }
            
            /* Footer */
            .footer-grid {
                gap: 20px;
            }
            
            .social-links a {
                width: 35px;
                height: 35px;
            }
        }