/*
Theme Name: Instagram Photo Downloader
Theme URI: https://instagramphotodownloader.it.com
Description: A modern, clean WordPress theme for Instagram photo downloading with responsive design and SEO optimization
Version: 1.0
Author: InstagramPhotoDownloader.it.com
Author URI: https://instagramphotodownloader.it.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: instagram-downloader
Tags: instagram, downloader, responsive, modern, clean, seo-friendly
*/

:root {
    --instagram-gradient-start: #833AB4;
    --instagram-gradient-middle: #E1306C;
    --instagram-gradient-end: #FD1D1D;
    --instagram-yellow: #FCAF45;
    --primary-bg: #ffffff;
    --secondary-bg: #fafafa;
    --text-primary: #262626;
    --text-secondary: #8e8e8e;
    --border-color: #dbdbdb;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(131, 58, 180, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--secondary-bg);
}

/* Header Styles */
.site-header {
    background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-middle), var(--instagram-gradient-end));
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo svg {
    width: 32px;
    height: 32px;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.main-navigation a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.main-navigation a:hover {
    opacity: 0.8;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--instagram-gradient-start), var(--instagram-gradient-middle), var(--instagram-gradient-end));
    padding: 80px 20px;
    text-align: center;
    color: white;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Downloader Form */
.downloader-section {
    max-width: 800px;
    margin: -60px auto 60px;
    padding: 0 20px;
}

.downloader-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.downloader-card:hover {
    box-shadow: var(--shadow-hover);
}

.downloader-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input[type="url"],
.form-group select {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input[type="url"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--instagram-gradient-middle);
    box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.1);
}

.quality-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.quality-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.quality-option:hover {
    border-color: var(--instagram-gradient-middle);
    background-color: rgba(225, 48, 108, 0.05);
}

.quality-option input[type="radio"] {
    cursor: pointer;
}

.quality-option input[type="radio"]:checked + label {
    font-weight: 600;
}

.download-btn {
    background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-middle), var(--instagram-gradient-end));
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-top: 10px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(131, 58, 180, 0.3);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Features Section */
.features-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.features-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-align: center;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-middle));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.feature-box h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-box p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Blog/News Section */
.blog-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.blog-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-middle));
}

.blog-card-content {
    padding: 24px;
}

.blog-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.blog-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.blog-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--instagram-gradient-middle);
    font-weight: 600;
    text-decoration: none;
}

/* Single Post Page */
.post-header {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.post-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.post-content {
    max-width: 800px;
    margin: 0 auto 60px;
    padding: 0 20px;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.post-content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.post-content p {
    margin-bottom: 20px;
    line-height: 1.8;
}

/* Footer */
.site-footer {
    background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-middle), var(--instagram-gradient-end));
    color: white;
    padding: 40px 20px 20px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-middle));
        padding: 20px;
        display: none;
    }

    .main-navigation.active {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .downloader-card {
        padding: 25px;
    }

    .quality-options {
        grid-template-columns: 1fr;
    }

    .features-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .post-content {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 60px 20px;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .download-btn {
        width: 100%;
    }
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* SEO & Performance Optimizations */

/* Lazy loading support */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Prevent layout shift */
img, video {
    max-width: 100%;
    height: auto;
}

/* Optimize fonts loading */
@font-face {
    font-display: swap;
}

/* Reduce paint areas */
.site-header {
    will-change: transform;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 3px solid var(--instagram-gradient-middle);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--instagram-gradient-middle);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}
