/* Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Space Grotesk', 'JetBrains Mono', monospace;
    background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #0d1b2a);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    color: #f0f0f0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Header */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.hero-section h1 {
    font-size: 3em;
    font-weight: 800;
    color: #00f7ff;
    text-shadow: 0 0 12px #00f7ff;
    letter-spacing: 2px;
}

.hero-section p {
    font-size: 1.3em;
    margin-top: 15px;
    color: #fff;
    opacity: 0.9;
    text-shadow: 0 0 8px #6a00f4;
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.15);
}

/* Form Elements */
.form-group label {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00f7ff;
}

select, input {
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
}

select:focus, input:focus {
    border-color: #00f7ff;
    outline: none;
    box-shadow: 0 0 10px #00f7ff;
}

/* Template Gallery */
.template-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.template-gallery img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.template-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #00f7ff;
}

.template-gallery img.selected {
    border-color: #00f7ff;
    box-shadow: 0 0 12px #00f7ff;
}

/* Buttons */
.btn {
    padding: 14px 22px;
    font-size: 1.1em;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-generate {
    background: linear-gradient(90deg, #00f7ff, #6a00f4);
    color: #fff;
    text-transform: uppercase;
    width: 100%;
    margin-top: 15px;
}

.btn-generate:hover {
    box-shadow: 0 0 20px #00f7ff;
    transform: translateY(-2px);
}

.btn-upload {
    background: linear-gradient(90deg, #ff00a8, #6a00f4);
    color: #fff;
    margin-top: 15px;
}

.btn-upload:hover {
    box-shadow: 0 0 15px #ff00a8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #333;
    color: #fff;
}

.btn-download {
    background: linear-gradient(90deg, #00c853, #009624);
    color: #fff;
}

.btn-social {
    background: linear-gradient(90deg, #1da1f2, #005f99);
    color: #fff;
}

/* Result Meme */
.meme-text-box {
    background: rgba(0,0,0,0.4);
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.2em;
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 8px #6a00f4;
}

.meme-image {
    max-width: 100%;
    border-radius: 20px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* Footer */
footer {
    text-align: center;
    padding: 25px 0;
    font-size: 0.9em;
    opacity: 0.8;
    border-top: 1px solid rgba(255,255,255,0.1);
}
