:root {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #4c00bf;
    --border-color: #2d2d2d;
    --font-main: 'Roboto', sans-serif;
    --font-title: 'Orbitron', sans-serif;
}

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

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap; 
}
.email-address {
    -webkit-user-select: text;
    user-select: text;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-family: var(--font-title);
    font-size: 1.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.3s ease;
}

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

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative; 
    width: 45px;
    height: 45px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    position: absolute;
    left: 10px;
}

.hamburger span:nth-child(1) { top: 10px; }
.hamburger span:nth-child(2) { top: 18px; }
.hamburger span:nth-child(3) { top: 26px; }

.hamburger.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.is-active span:nth-child(2) {
    opacity: 0;
}
.hamburger.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.main-content {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem; 
}

.generator-container {
    width: 100%;
    max-width: 850px;
}

.title-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.title-icon {
    margin-bottom: 1rem;
}

.title-section h2 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.title-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.prompt-area {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap; 
}

.prompt-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 200px;
}

.prompt-base {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-main);
    resize: none;
    min-height: 60px; /* MODIFIED: Changed from height to min-height */
    padding: 0;
    margin: 0;
    line-height: 1.5;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.prompt-real {
    position: relative;
    z-index: 2;
    background-color: transparent; 
    caret-color: var(--accent-color);
    overflow-y: hidden; /* ADDED: Prevents scrollbar from flashing during resize */
}

.prompt-ghost {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    color: var(--text-secondary);
    pointer-events: none;
}

.prompt-controls {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.control-btn, #generate-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.control-btn {
    background-color: var(--secondary-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

#generate-btn {
    background-color: var(--accent-color);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#generate-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(58, 134, 255, 0.5), transparent);
    transition: transform 0.5s ease-out;
    transform: translate(-50%, -50%) scale(0);
    z-index: -1;
}

#generate-btn:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.modal.is-visible {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--secondary-bg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    width: 90%; 
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- MODIFIED AND NEW STYLES FOR INFO MODAL --- */

.info-modal .modal-content {
    max-width: 600px; /* Modern medium size */
    padding: 0; /* Reset padding to structure with header/content */
}

.info-modal .modal-content h3 {
    font-family: var(--font-title);
    padding: 1.5rem 2rem; /* Add padding to the header */
    margin: 0; /* Reset margin */
    border-bottom: 1px solid var(--border-color); /* Separator line */
    text-align: left; /* Align title to the left */
}

.info-content {
    text-align: left;
    padding: 1.5rem 2rem 2rem; /* Add padding to the content area */
    margin-top: 0;
}

.info-content h4 {
    color: var(--text-primary); /* Brighter color for sub-headings */
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}
.info-content h4:first-child {
    margin-top: 0;
}

.info-content p {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.7; /* Increased line-height for readability */
}

.close-btn {
    color: var(--text-secondary);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 44px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: transparent;
}

.close-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
    transform: rotate(90deg);
}

/* --- END OF MODIFIED STYLES --- */

.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.style-option, .ratio-option {
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.style-option:hover, .style-option.selected,
.ratio-option:hover, .ratio-option.selected {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.ratio-option span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.ratio-option:hover span, .ratio-option.selected span {
    color: var(--text-primary);
}

.result-container, .error-container {
    margin-top: 3rem;
    text-align: center;
    display: none;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 0 auto 1.5rem;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.image-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 1.5s infinite;
    transform: translateX(-100%);
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.result-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.result-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease;
}

.result-image-wrapper:hover .result-image {
    transform: scale(1.05);
}

.download-link {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    text-decoration: none;
}

.result-image-wrapper:hover .download-link {
    opacity: 1;
    transform: translateY(0);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.result-actions button {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.result-actions button:hover {
    background-color: var(--border-color);
}

.error-container {
    background-color: #2a1a1a;
    color: #ff8c8c;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #5c2a2a;
}

.prompt-error {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    text-align: left;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .main-content { padding: 2rem 1rem; }
    .title-icon { display: none; }
    .title-section h2 { font-size: 2rem; }
    .title-section p { font-size: 1rem; }
    .prompt-area { flex-direction: column; padding: 1rem; }
    .prompt-wrapper { width: 100%; }
    .prompt-base { text-align: center; }
    .prompt-controls { width: 100%; justify-content: center; }
    .result-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .main-header { flex-direction: row; justify-content: space-between; padding: 1rem; }
    .hamburger { display: block; }
    nav { 
        display: flex; 
        flex-direction: column; 
        justify-content: center; 
        align-items: center; 
        gap: 2rem; 
        position: fixed; 
        top: 0; 
        left: 0;
        width: 100%; 
        height: 100%; 
        background-color: var(--primary-bg); 
        transform: translateX(100%); 
        transition: transform 0.3s ease-in-out; 
        z-index: 1000; 
    }
    nav.is-active { 
        transform: translateX(0); 
    }
    nav a { 
        margin-left: 0; 
        font-size: 1.5rem; 
        color: var(--text-primary); 
    }
}

@media (max-width: 480px) {
    .control-btn, #generate-btn { padding: 0.75rem 1rem; width: 100%; justify-content: center; }
    .prompt-controls { flex-direction: column; }
    .result-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}