/* General Body and Typography */
:root {
    --bg-dark: #12121f; /* Slightly darker background */
    --card-bg-1: #1a1a2e; /* Original card bg */
    --card-bg-2: #1e1a38; /* Slightly different card bg */
    --card-bg-3: #1a2e2e; /* Another different card bg */
    --text-light: #e0e0e0;
    --primary-glow: #00e6e6; /* Aqua/Cyan - New glow color */
    --secondary-glow: #9933ff; /* Purple - New glow color */
    --accent-color: #00bcd4; /* Teal - Kept same for titles etc. */
    --button-bg: #0f3460;
    --button-hover-bg: #1a4f8d;
    --border-color: #0d1a2f;
    --input-bg: #0f1628;
    --input-border: #283747;

    /* Reduced glow RGB values for JS */
    --primary-glow-rgb: 0, 230, 230;
    --secondary-glow-rgb: 153, 51, 255;
    --accent-color-rgb: 0, 188, 212;
}

/* Footer Styles - Modified to include social links */
/* --- Footer Styling --- */
.footer {
    background-color: #0d0d1a; /* Darker background for footer */
    color: #e0e0e0;
    padding: 40px 20px;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: space-around; /* Distribute items */
    flex-direction: column;    /* Add or change to column */
    align-items: center;       /* Add or change to center */
    text-align: center;        /* Add or change to center */
    gap: 30px; /* Space between flex items */
    border-top: 2px solid #2a2a40; /* Subtle top border */
}

.footer-content {
    /* ... existing properties ... */
    align-items: center;       /* Add or change to center */
    text-align: center;        /* Add or change to center */
    width: 100%;               /* Add or ensure this */
    max-width: 500px;          /* Optional: Add this line for readability */
}

.footer-content p {
    margin: 5px 0;
    font-size: 0.95em;
    color: #cccccc;
}

.social-links {
    margin-top: 15px;
}

.social-button {
    display: inline-flex; /* Allows icon and text on one line */
    align-items: center;
    background-color: #1a1a2e; /* Darker button background */
    color: var(--accent-color, #e94560); /* Use defined accent color */
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); /* Subtle shadow */
}

.social-button i {
    margin-right: 8px;
    font-size: 1.2em;
}

.social-button:hover {
    background-color: var(--accent-color, #e94560);
    color: white;
    transform: translateY(-3px); /* Lift effect */
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4); /* Enhanced glow on hover */
}


/* --- Contact Form Styling --- */
.contact-form-section {
    background-color: #1a1a2e; /* Darker background for form section */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); /* Stronger shadow for depth */
    width: 100%; /* Take full width on small screens */
    max-width: 450px; /* Max width for larger screens */
    box-sizing: border-box; /* Include padding in width */
    position: relative; /* For positioning the animation */
    overflow: hidden; /* Hide overflow of glow/animation */
    border: 1px solid #2a2a40; /* Subtle border */
    transition: box-shadow 0.3s ease; /* Smooth glow transition */
}

.contact-form-section:hover {
    box-shadow: 0 0 30px var(--accent-color, #e94560); /* Brighter glow on hover */
}


.contact-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2em;
    color: var(--accent-color, #e94560); /* Use accent color for title */
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 0 8px rgba(233, 69, 96, 0.3); /* Subtle text glow */
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-size: 1em;
    color: #e0e0e0;
    margin-bottom: 8px;
    text-align: center;        /* Add or change to center */
    font-weight: 600;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: #2a2a40; /* Input background */
    border: 1px solid #4a4a60; /* Input border */
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--accent-color, #e94560);
    outline: none;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5); /* Focus glow */
}

/* Make message textbox big */
.contact-form textarea {
    min-height: 120px; /* Adjust height as needed */
    resize: vertical; /* Allow vertical resizing by user */
}

.submit-button {
    width: 100%;
    padding: 15px 25px;
    background-color: var(--accent-color, #e94560);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.4); /* Glow effect */
}

.submit-button:hover {
    background-color: #c93550; /* Slightly darker on hover */
    transform: translateY(-2px); /* Lift effect */
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.6); /* Stronger glow on hover */
}

.submit-button:disabled {
    background-color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* --- Mail Sent Animation --- */
.mail-sent-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Semi-transparent dark overlay */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5em;
    border-radius: 10px;
    opacity: 0; /* Hidden by default */
    transform: scale(0.8); /* Start slightly smaller */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    pointer-events: none; /* Do not block interaction when hidden */
}

.mail-sent-animation.show-animation {
    opacity: 1;
    transform: scale(1);
    pointer-events: all; /* Allow interaction (if any) when visible */
}

.mail-sent-animation .check-icon {
    font-size: 4em;
    color: #4CAF50; /* Green checkmark */
    animation: scaleIn 0.6s ease-out;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(76, 175, 80, 0.6); /* Green glow */
}

.mail-sent-animation .sent-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2em;
    font-weight: 700;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .contact-form-section {
        width: 90%;
        max-width: none; /* Remove max-width on smaller screens */
    }
}



body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    perspective: 1000px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: var(--card-bg-1);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 100;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 100px;
    height: 100px;
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent-color);
    animation: neonText 2s infinite alternate;
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 1.1em;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-glow);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.nav-item:hover {
    color: var(--primary-glow);
    text-shadow: 0 0 2px var(--primary-glow); /* FURTHER REDUCED GLOW */
}

.nav-item:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border-radius: 25px;
    padding: 5px 15px;
    border: 1px solid var(--input-border);
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2); /* FURTHER REDUCED SHADOW */
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: var(--primary-glow);
    box-shadow: 0 0 3px var(--primary-glow); /* FURTHER REDUCED GLOW */
}

.search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-light);
    font-size: 1em;
    padding: 5px 10px;
    width: 200px;
}

.search-input::placeholder {
    color: #888;
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.search-button svg {
    color: var(--accent-color);
    transition: color 0.3s ease, transform 0.3s ease;
}

.search-button:hover svg {
    color: var(--primary-glow);
    transform: scale(1.1);
}

/* Intro Section Styles */
.intro-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 60px auto 40px auto;
    padding: 0 40px;
}

.intro-paragraph {
    max-width: 65%;
    font-size: 1.15em;
    line-height: 1.8;
    color: var(--text-light);
    text-align: left;
    background-color: rgba(var(--primary-glow-rgb), 0.03); /* FURTHER REDUCED OPACITY */
    padding: 25px;
    border-radius: 10px;
    border-left: 3px solid var(--primary-glow);
    box-shadow: 0 0 10px rgba(0,0,0,0.3); /* FURTHER REDUCED SHADOW */
    transition: all 0.3s ease;
}

.intro-paragraph:hover {
    box-shadow: 0 0 15px rgba(0,0,0,0.4), 0 0 5px var(--primary-glow); /* FURTHER REDUCED GLOW */
    background-color: rgba(var(--primary-glow-rgb), 0.05); /* FURTHER REDUCED OPACITY */
}

.intro-logo {
    width: 300px;
    height: auto;
    filter: drop-shadow(0 0 px var(--secondary-glow)); /* FURTHER REDUCED GLOW */
    animation: rotateAndGlow 8s infinite linear;
}

/* Main Container and Card Styles */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    padding: 60px 40px;
    max-width: 1200px;
    margin: 40px auto;
}

.card {
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
    background-color: var(--card-bg-1);
}

/* Specific Card Backgrounds */
.step-by-step {
    background-color: var(--card-bg-1);
}
.esp-web-flasher {
    background-color: var(--card-bg-2);
}
.about-espduino-hub {
    background-color: var(--card-bg-3);
}


.card:hover {
    transform: translateY(-8px) scale(1.005) rotateX(1deg); /* FURTHER REDUCED TRANSFORM */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5); /* FURTHER REDUCED SHADOW */
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(var(--primary-glow-rgb), 0.02) 0%, transparent 70%); /* FURTHER REDUCED OPACITY */
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.card:hover::before {
    opacity: 0.5; /* FURTHER REDUCED OPACITY */
}

/* Glow Border Effect */
.glow-border {
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.glow-border::after {
    content: '';
    position: absolute;
    top: -2px; /* FURTHER REDUCED OFFSET */
    left: -2px; /* FURTHER REDUCED OFFSET */
    right: -2px; /* FURTHER REDUCED OFFSET */
    bottom: -2px; /* FURTHER REDUCED OFFSET */
    border-radius: 18px;
    background: linear-gradient(45deg, var(--primary-glow), var(--secondary-glow));
    z-index: -1;
    opacity: 0;
    filter: blur(2px); /* FURTHER REDUCED BLUR */
    transition: opacity 0.4s ease, filter 0.4s ease;
    animation: border-glow 3s infinite alternate ease-in-out paused;
    pointer-events: none;
}

.card:hover.glow-border::after {
    opacity: 0.3; /* FURTHER REDUCED OPACITY ON HOVER */
    filter: blur(4px); /* FURTHER REDUCED BLUR ON HOVER */
    animation-play-state: running;
}

/* Card Content */
.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2em;
    color: var(--accent-color);
    margin-bottom: 20px;
    text-shadow: 0 0 2px var(--primary-glow); /* FURTHER REDUCED GLOW */
    position: relative;
    z-index: 2;
}

.card-description {
    font-size: 1.1em;
    color: var(--text-light);
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.card-button {
    background-color: var(--button-bg);
    color: var(--text-light);
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.card-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    z-index: -1;
}

.card-button:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-2px); /* FURTHER REDUCED TRANSFORM */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); /* FURTHER REDUCED SHADOW */
    color: var(--primary-glow);
}

.card-button:hover::before {
    width: 150%; /* FURTHER REDUCED SIZE */
    height: 150%; /* FURTHER REDUCED SIZE */
    opacity: 0.08; /* FURTHER REDUCED OPACITY */
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 30px;
    background-color: var(--card-bg-1);
    border-top: 2px solid var(--border-color);
    margin-top: 60px;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    font-size: 0.9em;
}

/* Animations */
@keyframes neonText {
    0% {
        text-shadow: 0 0 1px var(--primary-glow), 0 0 2px var(--primary-glow); /* FURTHER REDUCED GLOW */
    }
    100% {
        text-shadow: 0 0 2px var(--primary-glow), 0 0 4px var(--primary-glow), 0 0 6px rgba(0, 230, 230, 0.3); /* FURTHER REDUCED GLOW */
    }
}

@keyframes pulseGlow {
    0% {
        filter: drop-shadow(0 0 1px var(--primary-glow)); /* FURTHER REDUCED GLOW */
    }
    100% {
        filter: drop-shadow(0 0 4px var(--primary-glow)) drop-shadow(0 0 8px rgba(0, 230, 230, 0.2)); /* FURTHER REDUCED GLOW */
    }
}

@keyframes border-glow {
    0% {
        opacity: 0.2; /* FURTHER REDUCED OPACITY */
        filter: blur(2px); /* FURTHER REDUCED BLUR */
        transform: scale(1);
    }
    50% {
        opacity: 0.4; /* FURTHER REDUCED OPACITY */
        filter: blur(3px); /* FURTHER REDUCED BLUR */
        transform: scale(1.005);
    }
    100% {
        opacity: 0.2; /* FURTHER REDUCED OPACITY */
        filter: blur(2px); /* FURTHER REDUCED BLUR */
        transform: scale(1);
    }
}

@keyframes rotateAndGlow {
    0% {
        transform: rotateY(0deg);
        filter: drop-shadow(0 0 3px var(--secondary-glow)); /* FURTHER REDUCED GLOW */
    }
    50% {
        filter: drop-shadow(0 0 8px var(--secondary-glow)) drop-shadow(0 0 12px rgba(153, 51, 255, 0.3)); /* FURTHER REDUCED GLOW */
    }
    100% {
        transform: rotateY(360deg);
        filter: drop-shadow(0 0 3px var(--secondary-glow)); /* FURTHER REDUCED GLOW */
    }
}

/* Dynamic glow effect for card hover */
.card::before {
    --x: 0px;
    --y: 0px;
    background: radial-gradient(circle at var(--x) var(--y), rgba(var(--primary-glow-rgb), 0.01) 0%, transparent 70%); /* VERY SUBTLE */
}


/* Responsive Design */
@media (max-width: 1024px) {
    .header {
        padding: 15px 30px;
    }
    .logo-text {
        font-size: 1.5em;
    }
    .nav ul {
        gap: 20px;
    }
    .nav-item {
        font-size: 1em;
    }
    .search-input {
        width: 150px;
    }
    .intro-section {
        flex-direction: column;
        text-align: center;
        margin: 40px auto 30px auto;
    }
    .intro-paragraph {
        max-width: 90%;
        margin-bottom: 30px;
        text-align: center;
    }
    .intro-logo {
        width: 200px;
    }
    .container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        padding: 40px 30px;
    }
    .card-title {
        font-size: 1.8em;
    }
    .card-description {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px;
    }
    .nav ul {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    .search-container {
        width: 80%;
        max-width: 300px;
        justify-content: center;
    }
    .search-input {
        width: 100%;
        text-align: center;
    }
    .intro-section {
        padding: 0 20px;
    }
    .intro-paragraph {
        max-width: 100%;
        padding: 20px;
    }
    .intro-logo {
        width: 150px;
    }
    .container {
        grid-template-columns: 1fr;
        padding: 30px 20px;
    }
    .card {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.3em;
    }
    .nav-item {
        font-size: 0.9em;
    }
    .card-title {
        font-size: 1.5em;
    }
    .card-description {
        font-size: 0.9em;
    }
    .card-button {
        padding: 12px 25px;
        font-size: 1em;
    }
    .intro-paragraph {
        font-size: 1em;
        padding: 15px;
    }
}