/* Variables for theming */
:root {
    --background-color: #f4f7f6;
    --text-color: #333;
    --header-bg: #2c3e50;
    --header-text: #fff;
    --accent-color: #ff7e5f; /* Orange */
    --accent-hover: #feb47b; /* Lighter Orange */
    --section-even-bg: #eef1f0;
    --card-bg: #fff;
    --card-shadow: rgba(0,0,0,0.05);
    --border-color: #ddd;
}

[data-theme='dark'] {
    --background-color: #282c34;
    --text-color: #e0e0e0;
    --header-bg: #21252b;
    --header-text: #e0e0e0;
    --accent-color: #8e2de2; /* Purple */
    --accent-hover: #4a00e0; /* Darker Purple */
    --section-even-bg: #323842;
    --card-bg: #3a404b;
    --card-shadow: rgba(0,0,0,0.3);
    --border-color: #555;
}

/* General Body Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 80%;
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px 0;
}

/* Header and Navigation */
header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 15px 0;
    box-shadow: 0 5px 15px var(--card-shadow);
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 1000; /* Ensure header stays on top */
}

header h1 {
    margin: 0;
    font-size: 24px;
    float: left;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    float: right;
}

header nav ul li {
    display: inline;
    margin-left: 20px;
}

header nav ul li a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: var(--accent-color);
}

/* Theme Toggle Button */
#theme-toggle {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--header-text);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

#theme-toggle:hover {
    color: var(--accent-color);
}

/* Clearfix for floats */
.container::after {
    content: "";
    display: table;
    clear: both;
}

/* Hero Section */
.hero {
    background: linear-gradient(45deg, var(--header-bg), #34495e);
    color: #fff;
    text-align: center;
    padding: 100px 0;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://via.placeholder.com/1500x800') no-repeat center center/cover;
    opacity: 0.2; /* Subtle background image */
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background: linear-gradient(45deg, var(--accent-color), #8e2de2); /* Orange to Purple */
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    background: linear-gradient(45deg, var(--accent-hover), #4a00e0); /* Lighter Orange to Darker Purple */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Sections General */
section {
    padding: 80px 0;
    text-align: center;
    background-color: var(--background-color);
    transition: background-color 0.3s;
}

section:nth-of-type(even) {
    background-color: var(--section-even-bg);
}

section h3 {
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

section h3::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Features Section */
.feature-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
}

.feature-item {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px var(--card-shadow);
    flex: 1;
    min-width: 280px;
    max-width: 30%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--card-shadow);
}

.feature-item h4 {
    font-size: 24px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.feature-item p {
    font-size: 16px;
    color: var(--text-color);
}

/* Contact Section */
.contact form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 10px 30px var(--card-shadow);
}

.contact form input[type="text"],
.contact form input[type="email"],
.contact form textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: border-color 0.3s, background-color 0.3s;
}

.contact form input[type="text"]:focus,
.contact form input[type="email"]:focus,
.contact form textarea:focus {
    border-color: var(--accent-color);
    outline: none;
}

.contact form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact form .btn {
    align-self: flex-start;
    border: none;
    cursor: pointer;
}

/* Footer */
footer {
    background-color: var(--header-bg);
    color: var(--header-text);
    text-align: center;
    padding: 30px 0;
    font-size: 14px;
    box-shadow: 0 -5px 15px var(--card-shadow);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 36px;
    }

    .hero p {
        font-size: 18px;
    }

    header h1,
    header nav ul {
        float: none;
        text-align: center;
    }

    header nav ul li {
        margin: 0 10px;
    }

    .feature-item {
        max-width: 45%;
    }

    #theme-toggle {
        position: static;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .feature-item {
        max-width: 90%;
    }

    .container {
        width: 90%;
    }

    .hero h2 {
        font-size: 30px;
    }

    .hero p {
        font-size: 16px;
    }

    section h3 {
        font-size: 28px;
    }
}