/* Global Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #f4f6f9;
    color: #333;
}

/* Sections */
.intro, .ad-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1em;
    justify-content: center;
}

/* Intro Section with Blue Gradient */
.intro {
    background: linear-gradient(135deg, #2a3d66, #4b6b8e, #6a8cbe, #334d68);
    color: white;
    padding: 4em 2em;
    text-align: center;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background-size: 300% 300%;
    animation: gradientAnimation 10s ease infinite;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.intro h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5em;
    font-weight: 700;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.intro h2 {
    font-size: 1.6rem;
    margin-bottom: 1em;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.intro p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 1em;
}

/* Logo in Intro Section */
.intro .logo {
    max-width: 200px;
    margin-top: 2em;
}

/* Input Section */
.ad-input {
    margin-top: 3em;
    padding: 3em;
    background-color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    transition: box-shadow 0.3s ease;
}

.ad-input:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.ad-input label {
    font-size: 1.1rem;
    margin-bottom: 0.5em;
    color: #2a3d66;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ad-input input[type="text"], .ad-input textarea {
    width: 100%;
    padding: 14px 16px;
    margin: 0.5em 0 1.5em;
    border-radius: 8px;
    border: 1px solid #2a3d66;
    font-size: 1rem;
    color: #333;
    transition: border-color 0.3s ease;
}

.ad-input input[type="text"]:focus, .ad-input textarea:focus {
    border-color: #4b6b8e;
    outline: none;
}

.ad-input input::placeholder, .ad-input textarea::placeholder {
    color: #2a3d66;
    opacity: 0.7;
}

.ad-input textarea {
    height: 120px;
    resize: none;
}

/* Buttons */
button {
    background: #2a3d66;
    color: white;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 320px;
    margin-top: 1.5em;
}

button:hover {
    background: #4b6b8e;
    transform: translateY(-4px);
}

button:active {
    transform: scale(0.98);
}

/* Ad Output */
.ad-output {
    display: none;
    width: 100%;
    max-width: 550px;
    margin: 2em auto;
    padding: 3em;
    background-color: #fff;
    border: 1px solid #2a3d66;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.ad-output h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5em;
}

.ad-output p {
    font-size: 1.3rem;
    color: #555;
}

/* Animation for Ad Output */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Media Queries */
@media (min-width: 768px) {
    main {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 3em;
    }
    
    .intro {
        max-width: 45%;
        padding: 3em 4em;
        background-size: contain;
        height: auto;
        text-align: left;
    }
    
    .ad-input {
        max-width: 45%;
        margin-top: 0;
        justify-content: center;
    }
    
    .ad-output {
        max-width: 45%;
    }
}

/* Small Screen Adjustments */
@media (max-width: 600px) {
    .intro h1 {
        font-size: 2.5rem;
    }

    .intro h2 {
        font-size: 1.3rem;
    }

    .ad-input label {
        font-size: 1rem;
    }
}
