/* Global Styles */
:root {
    --primary-color: #ff69b4;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --accent-color: #ff1493;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

/* Header Styles */
header {
    position: fixed;
    width: 100%;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

/* Common Section Styles */
section {
    padding: 5rem 2rem;
}

h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

/* About Section */
.about {
    background: var(--secondary-color);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card h3, .blog-card p {
    padding: 1rem;
}

.blog-card a {
    text-decoration: none;
    color: var(--text-color);
}

/* Contact Form */
.contact {
    background: var(--secondary-color);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.contact-form textarea {
    height: 150px;
}

/* Form Messages */
.form-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    text-align: center;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.cta-button:hover {
    background: var(--accent-color);
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 1rem;
    text-align: center;
}

.footer-bottom {
    text-align: center;
    padding: 1rem 0;
}

/* Mobile Menu Styles */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--text-color);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.menu-toggle.active span:first-child {
    transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Lazy Loading Styles */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img[src] {
    opacity: 1;
}

/* Touch-friendly Styles */
.gallery-item {
    touch-action: pan-y pinch-zoom;
}

.touch-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        width: 95%;
        margin: 0 auto;
    }
    
    .blog-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Navigation */
    nav {
        flex-direction: column;
        padding: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    nav .logo {
        margin-bottom: 1rem;
    }
    
    /* Hero Section */
    .hero {
        min-height: 80vh;
        padding: 6rem 1rem 2rem;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    /* Grid Layouts */
    .blog-grid,
    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Forms */
    .contact-form {
        padding: 1rem;
    }
    
    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        width: 100%;
    }
    
    /* Blog Posts */
    .blog-post {
        padding: 1rem;
    }
    
    .blog-post h1 {
        font-size: 1.8rem;
    }
    
    .blog-post img {
        width: 100%;
        height: auto;
    }
    
    /* Tables and Lists */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Section Spacing */
    section {
        padding: 3rem 1rem;
    }
    
    /* Mobile Menu */
    .menu-toggle {
        display: flex;
    }

    nav ul {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--secondary-color);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        z-index: 9;
    }

    nav ul.active {
        transform: translateY(0);
    }

    nav ul li {
        margin: 1rem 0;
    }

    nav ul li a {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }
}

@media (max-width: 480px) {
    /* Smaller Text */
    body {
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* Tighter Spacing */
    section {
        padding: 2rem 1rem;
    }
    
    /* Button Sizing */
    .cta-button {
        width: 100%;
        text-align: center;
        padding: 0.8rem 1.5rem;
    }
    
    /* Form Elements */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Touch Target Sizes */
button,
.nav-link,
.cta-button {
    min-height: 44px;
    min-width: 44px;
    padding: 0.8rem 1.5rem;
}

/* Prevent Text Selection During Touch */
.no-select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Touch Device Optimizations */
@media (hover: none) {
    .cta-button:hover {
        background: var(--primary-color); /* Remove hover state on touch devices */
    }
    
    nav a {
        padding: 0.5rem 0; /* Larger touch targets */
    }
}

/* Print Styles */
@media print {
    .hero,
    nav,
    .cta-button,
    .contact-form,
    footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    h1 {
        font-size: 18pt;
    }
    
    h2 {
        font-size: 16pt;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --text-color: #000000;
    }
    
    body {
        background: white;
    }
    
    * {
        border-color: black !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #ff8dc7;
        --secondary-color: #2d2d2d;
        --text-color: #ffffff;
    }
    
    body {
        background: #1a1a1a;
    }
    
    .blog-card,
    .feature {
        background: #2d2d2d;
    }
}
