/* ==========================================================================
   BrainDanceAI.com — Main Stylesheet
   AI Consulting, Data Analysis & Web Design Practice
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET & BASE
   -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --color-accent: #E53F48;
    --color-text: #522E38;
    --color-text-light: #7a5a64;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f6f5;
    --color-border: #e8e0dd;
    --color-input-bg: #f0f8f8;
    --color-success: #4CAF50;
    --color-error: #E53F48;
    --font-primary: 'Poppins', sans-serif;
    --max-width: 1100px;
    --header-height: 70px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #d13540;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: var(--font-primary);
}

input, textarea, select, button {
    font-family: inherit;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY
   -------------------------------------------------------------------------- */

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.25;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
}

p {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
}

.section-label {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.text-light {
    color: var(--color-text-light);
}

/* --------------------------------------------------------------------------
   3. LAYOUT
   -------------------------------------------------------------------------- */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* --------------------------------------------------------------------------
   4. HEADER / NAVIGATION
   -------------------------------------------------------------------------- */

header.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    transition: background 0.3s, box-shadow 0.3s;
}

header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-text {
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

.logo-text .brain {
    color: var(--color-text);
    font-weight: 700;
}

.logo-text .dance {
    color: var(--color-text-light);
    font-weight: 300;
}

.nav-links {
    display: none;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent);
}

/* Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--color-text);
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
}

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

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

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

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 999;
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav a {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   5. HERO SECTION
   -------------------------------------------------------------------------- */

.hero {
    padding: 8rem 0 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(232, 224, 221, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(232, 224, 221, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(229, 63, 72, 0.03) 0%, transparent 70%),
        linear-gradient(135deg, rgba(248, 246, 245, 0.5) 0%, rgba(255, 255, 255, 0) 50%);
    pointer-events: none;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    max-width: 800px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.hero .subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hero .cta-btn {
    display: inline-block;
    margin-top: 2.5rem;
    padding: 0.85rem 2.5rem;
    background: var(--color-accent);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s;
    letter-spacing: 0.05em;
    position: relative;
}

.hero .cta-btn:hover {
    background: #d13540;
    color: white;
}

/* --------------------------------------------------------------------------
   6. CARDS
   -------------------------------------------------------------------------- */

.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(82, 46, 56, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(82, 46, 56, 0.1);
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--color-accent);
}

.card-excerpt {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 1rem;
}

.category-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-bg-alt);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   7. PROJECT DETAIL PAGE
   -------------------------------------------------------------------------- */

.project-hero {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.project-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(82, 46, 56, 0.85), transparent 60%);
}

.project-hero-content {
    position: absolute;
    bottom: 3rem;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
}

.project-hero-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.project-hero-content .subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    opacity: 0.9;
}

.project-section {
    margin-bottom: 3rem;
}

.project-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.project-gallery img {
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.project-gallery img:hover {
    transform: scale(1.02);
}

.project-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   8. BLOG POST PAGE
   -------------------------------------------------------------------------- */

.post-header {
    text-align: center;
    padding: 3rem 0 2rem;
    max-width: 750px;
    margin: 0 auto;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.post-featured-image {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 3rem;
    border-radius: 8px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    display: block;
}

.post-body {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-body h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: var(--color-text-light);
    font-style: italic;
}

.post-body img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   9. FILTER UI
   -------------------------------------------------------------------------- */

.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-primary);
}

.filter-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.filter-btn.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   10. CONTACT FORM
   -------------------------------------------------------------------------- */

.contact-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group label .optional {
    font-weight: 400;
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text-light);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    background: var(--color-input-bg);
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--color-text);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-group textarea {
    min-height: 180px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    border-radius: 99px;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}

.btn:hover {
    background: var(--color-accent);
    color: white;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: #d13540;
}

/* --------------------------------------------------------------------------
   11. FOOTER
   -------------------------------------------------------------------------- */

.site-footer {
    background: var(--color-text);
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 0 2rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-mission {
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.85);
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* --------------------------------------------------------------------------
   12. SERVICES GRID
   -------------------------------------------------------------------------- */

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.service-item {
    text-align: center;
    padding: 2rem 1rem;
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.service-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.service-item p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   13. ADMIN STYLES
   -------------------------------------------------------------------------- */

.admin-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.admin-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.admin-card .stat-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.admin-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--color-bg-alt);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    font-weight: 600;
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border);
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-published {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-draft {
    background: #fff3e0;
    color: #ef6c00;
}

.admin-form textarea.code-editor {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    min-height: 500px;
    line-height: 1.6;
    tab-size: 4;
}

.admin-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.admin-toolbar button {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--color-border);
    background: white;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-primary);
}

.admin-toolbar button:hover {
    background: var(--color-bg-alt);
}

.login-form {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   14. UTILITY CLASSES
   -------------------------------------------------------------------------- */

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.hidden {
    display: none;
}

/* --------------------------------------------------------------------------
   15. MVC FRAMEWORK STYLES
   -------------------------------------------------------------------------- */

.template {
    display: none;
}

.load-data.loading {
    opacity: 0.5;
    pointer-events: none;
}

.load-data.load-error {
    border-left: 3px solid var(--color-error);
    padding-left: 0.5rem;
}

.load-data:not(.loaded):not(.loading) [class*="view-"] {
    visibility: hidden;
}

#cache-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #333;
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    z-index: 9999;
}

#cache-toolbar button {
    background: var(--color-success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

#cache-toolbar button:hover {
    filter: brightness(0.9);
}

#cache-toolbar .status {
    margin-left: auto;
}

/* --------------------------------------------------------------------------
   16. MESSAGES / ALERTS
   -------------------------------------------------------------------------- */

.message {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.message-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.message-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* --------------------------------------------------------------------------
   17. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */

/* --- Small Tablet (640px) --- */
@media (min-width: 640px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Tablet (768px) --- */
@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 3.25rem;
    }

    .project-hero {
        height: 60vh;
    }
}

/* --- Desktop (1024px) --- */
@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }

    .hamburger {
        display: none;
    }

    .mobile-nav {
        display: none;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
