/* --- TFRO AI Gallery - Next Level Professional UI --- */

/* --- 1. Variables & Global Styles --- */
:root {
    --bg-color: #0e0e0e;
    --surface-color: #1b1b1b;
    --primary-color: #00aaff;
    --primary-hover: #0088cc;
    --text-color: #e0e0e0;
    --text-muted: #999;
    --border-color: #2a2a2a;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --transition: all 0.25s ease;
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Base Typography --- */
body {
    font-family: var(--font-family);
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}
h1 { font-size: 3rem; letter-spacing: -0.5px; }
h2 { font-size: 2rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-hover); }

img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

/* --- 2. Layout --- */
.container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
}

main {
    flex-grow: 1;
    padding: 2rem 0 8rem 0;
}

/* --- 3. Header --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(45deg, #00aaff, #aa00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}
nav a {
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}
nav a:hover { color: var(--text-color); }

/* --- Mobile Menu --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}
.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
}

@media (max-width: 768px) {
    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100%;
        background: rgba(15, 15, 15, 0.97);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem;
        gap: 1.5rem;
        transition: right 0.35s ease;
    }
    nav ul.active { right: 0; }

    .menu-toggle { display: flex; }
}

/* --- 4. Page Intro --- */
.page-intro {
    text-align: center;
    padding: 2rem;
}
.page-intro h1 {
    background: -webkit-linear-gradient(45deg, #00aaff, #aa00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}
.page-intro p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- 5. Gallery Grid (Pro Square Masonry) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    justify-items: center;
}

.card {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-color);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}
.card:hover img { transform: scale(1.08); }

.card .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 60%);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 1rem;
}
.card:hover .card-overlay { opacity: 1; }
.card .prompt-text {
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
}

/* --- 6. Generator Bar --- */
.generator-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1.5rem 0;
}

.generator-bar form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 90%;
}

.generator-bar .input-wrapper { flex-grow: 1; }

.generator-bar input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}
.generator-bar input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.3);
    outline: none;
}

.generator-bar button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.generator-bar button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}
.generator-bar button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* --- Mobile Generator --- */
@media (max-width: 768px) {
    .generator-bar form {
        flex-direction: column;
        width: 95%;
        gap: 0.75rem;
    }

    .generator-bar input,
    .generator-bar button {
        width: 100%;
        font-size: 1rem;
    }
}

/* --- 7. Footer --- */
.main-footer {
    background: var(--surface-color);
    color: var(--text-muted);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}
.main-footer a { color: var(--text-color); }

/* --- 8. Utility --- */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}










/* === Mobile Optimized Sticky Generator Bar (No Overflow + 70/30 Split) === */
@media (max-width: 768px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .generator-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(18, 18, 18, 0.96);
    backdrop-filter: blur(8px);
    padding: 10px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.55);
    z-index: 9999;
    box-sizing: border-box;
  }

  .generator-bar .container {
    width: 100%;
    padding: 0;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .generator-bar form {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .generator-bar .input-wrapper {
    flex: 1 1 70%;
  }

  .generator-bar input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    box-sizing: border-box;
  }

  .generator-bar input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }

  .generator-bar button {
    flex: 0 0 30%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #007bff;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    box-sizing: border-box;
  }

  .generator-bar button:hover {
    background: #0069e6;
  }

  /* Space for sticky bar */
  body {
    padding-bottom: 80px;
  }
}







/* --- Mobile Footer: Fixed to Bottom --- */
@media (max-width: 768px) {
  .main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1.8rem 0; /* increased height for visibility */
    text-align: center;
    font-size: 1rem;
    z-index: 900; /* below sticky input bar but above content */
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.5);
  }

  .main-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .main-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
  }

  .main-footer a:hover {
    color: var(--primary-hover);
  }

  /* prevent content from hiding behind the fixed footer */
  body {
    padding-bottom: 90px; /* same as footer height */
  }
}

