/*
Theme Name: TFP
Author: Antigravity
Description: A clean, web3-styled theme with sidebar navigation for TabForPiano.
Version: 1.0.0
*/

/* ============================================
   MD3 Color System - Light Mode
   ============================================ */
:root {
    /* Layout Variables */
    --tfp-sidebar-width: 250px;
    --tfp-topbar-height: 56px;
    --tfp-font-family: 'Inter', sans-serif;

    /* Global MD3 Font Overrides - Corrected Tokens */
    /* 1. Base Reference Fonts */
    --md-ref-typeface-brand: 'Inter', sans-serif;
    --md-ref-typeface-plain: 'Inter', sans-serif;
    --md-ref-typeface-weight-regular: 400;
    --md-ref-typeface-weight-medium: 500;

    /* 2. System Typescale (The variables actually used by components) */
    --md-sys-typescale-display-large-font: 'Inter', sans-serif;
    --md-sys-typescale-display-medium-font: 'Inter', sans-serif;
    --md-sys-typescale-display-small-font: 'Inter', sans-serif;

    --md-sys-typescale-headline-large-font: 'Inter', sans-serif;
    --md-sys-typescale-headline-medium-font: 'Inter', sans-serif;
    --md-sys-typescale-headline-small-font: 'Inter', sans-serif;

    --md-sys-typescale-title-large-font: 'Inter', sans-serif;
    --md-sys-typescale-title-medium-font: 'Inter', sans-serif;
    --md-sys-typescale-title-small-font: 'Inter', sans-serif;

    --md-sys-typescale-label-large-font: 'Inter', sans-serif;
    --md-sys-typescale-label-medium-font: 'Inter', sans-serif;
    --md-sys-typescale-label-small-font: 'Inter', sans-serif;

    --md-sys-typescale-body-large-font: 'Inter', sans-serif;
    --md-sys-typescale-body-medium-font: 'Inter', sans-serif;
    --md-sys-typescale-body-small-font: 'Inter', sans-serif;

    /* MD3 Surface Colors */
    --md-sys-color-surface: #fdfcff;
    --md-sys-color-surface-container: #f3f3f8;
    --md-sys-color-on-surface: #1a1c1e;
    --md-sys-color-on-surface-variant: #43474e;
    --md-sys-color-outline: #74777f;

    /* MD3 Primary (Dark Navy Accent) */
    --md-sys-color-primary: #0D2A57;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #dce7ff;
    --md-sys-color-on-primary-container: #001844;

    /* MD3 Secondary (Tonal) */
    --md-sys-color-secondary-container: #e3e6f0;
    --md-sys-color-on-secondary-container: #1b1e26;

    /* Web3 Effects */
    --tfp-glass-bg: rgba(255, 255, 255, 0.85);

    /* Legacy Compatibility */
    --tfp-bg-color: var(--md-sys-color-surface-container);
    --tfp-sidebar-bg: var(--md-sys-color-surface);
    --tfp-text-color: var(--md-sys-color-on-surface);
    --tfp-primary-color: var(--md-sys-color-primary);
}

/* ============================================
   Material Symbols Configuration
   ============================================ */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--tfp-font-family);
    background-color: var(--tfp-bg-color);
    background-image: url('assets/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--tfp-text-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Force MD Web Components to respect font */
:root,
md-list-item,
md-filled-button,
md-text-button,
md-icon-button,
md-dialog,
md-menu-item {
    font-family: var(--tfp-font-family) !important;
}

/* Force MD Web Components to respect font */
:root,
md-list-item,
md-filled-button,
md-text-button,
md-icon-button,
md-dialog,
md-menu-item {
    font-family: var(--tfp-font-family);
}

/* Force MD Web Components to respect font */
:root,
md-list-item,
md-filled-button,
md-text-button,
md-icon-button,
md-dialog,
md-menu-item {
    font-family: var(--tfp-font-family);
}

/* ============================================
   Layout Wrapper
   ============================================ */
#page-wrapper {
    display: flex;
    flex: 1;
    /* Topbar height (56) + Top Gap (8) + Gap between (8) */
    margin-top: calc(var(--tfp-topbar-height) + 16px);
    padding: 0 8px 8px 8px;
    /* Reduced gaps: Right/Bottom/Left */
}

/* Top Bar styles are in css/topbar.css */

/* Sidebar styles are in css/sidebar.css */
/* #tfp-sidebar matches the width variable */

/* Main Content */
/* ============================================
   Content Column (Wraps Piano + Main)
   ============================================ */
#tfp-content-col {
    flex: 1;
    margin-left: calc(var(--tfp-sidebar-width) + 8px);
    /* Sidebar (250) + Left Gap (8) */
    display: flex;
    flex-direction: column;
}

/* ============================================
   Main Content Area
   ============================================ */
#tfp-main {
    width: 100%;

    /* Glassmorphic Card Style */
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;

    /* Thin Glass Border */
    border: 1px solid #ddd;
    box-shadow: none;

    /* Fixed height with scrollable content */
    flex-grow: 1;
    max-height: calc(100vh - var(--tfp-topbar-height) - 16px - 100px - 8px - 8px);
    /* 100vh - topbar(56px) - topbar-margin(16px) - piano(100px) - piano-margin(8px) - bottom-gap(8px) */
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Sidebar Components are now in css/sidebar.css */

/* Content Loop - Ensures footer sticks to bottom */
.content-loop {
    display: flex;
    flex-direction: column;
}

/* ============================================
   Footer (Sticky Bottom)
   ============================================ */
/* ============================================
   Footer (Redesigned)
   ============================================ */
.site-footer {
    margin-top: auto;
    padding: 48px 24px 24px;

    /* Glassmorphic Style */
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 12px 12px;
    border: 1px solid rgba(221, 221, 221, 0.5);
}

.footer-main {
    margin-bottom: 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin: 0;
    letter-spacing: 0.01em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--md-sys-color-primary);
}

.vid.hero-bg-image {
    aspect-ratio: 16/9;
}

.footer-description {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
    line-height: 1.5;
}

/* Footer Brand Column */
.footer-brand-col {
    gap: 20px;
}

.footer-logo-link {
    display: inline-block;
    line-height: 0;
}

.footer-logo {
    height: 36px;
    width: auto;
    display: block;
}

.footer-brand-text {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    margin: 0;
}


.footer-newsletter {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.newsletter-input-row {
    display: flex;
    gap: 8px;
}

.footer-newsletter input[type="email"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: var(--tfp-font-family);
    background: rgba(255, 255, 255, 0.8);
    color: var(--md-sys-color-on-surface);
}

.footer-newsletter input[type="email"]:focus {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

/* Newsletter GDPR Label */
.newsletter-gdpr-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
}

.newsletter-gdpr-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--md-sys-color-primary);
    cursor: pointer;
}

.newsletter-gdpr-label a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    font-weight: 600;
}

.newsletter-gdpr-label a:hover {
    text-decoration: underline;
}

/* Newsletter Response Message */
.newsletter-msg {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 0;
}

.newsletter-msg-success {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.newsletter-msg-error {
    background: rgba(193, 55, 61, 0.08);
    color: #c1373d;
    border: 1px solid rgba(193, 55, 61, 0.2);
}


.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(59, 116, 224, 0.1);
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.social-icon:hover {
    background: var(--md-sys-color-primary);
    color: white;
    transform: translateY(-2px);
}

.social-icon i {
    font-size: 18px;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-copyright,
.footer-tagline {
    margin: 0;
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

.footer-tagline {
    font-weight: 600;
    color: var(--md-sys-color-primary);
}

.footer-attribution {
    font-size: 0.6rem;
    opacity: 0.15;
    transition: opacity 0.3s ease;
    margin: 4px 0 0 0;
}

.footer-attribution:hover {
    opacity: 0.8;
}

.footer-attribution a {
    color: inherit;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    #tfp-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        /* Optional: Add a toggle to show it later */
        display: none;
    }

    #tfp-content-col {
        margin-left: 0 !important;
        /* Reset margin */
        width: 100%;
        padding: 0 8px;
        /* Add slight padding for edge breathing */
    }

    #tfp-main {
        margin-left: 0;
        width: 100%;
        max-height: calc(100vh - var(--tfp-topbar-height) - 16px);
        /* Adjust height calc if piano is hidden or stacked */

        border: 1px solid #DDDDDD;
    }

    #page-wrapper {
        padding: 0;
    }
}

.desktop-only-flex {
    margin-top: -4px;
    margin-left: 20px;
}