<?php
/**
 * Google Inspired Classic CSS variables and layout
 */
?>

/* CSS Variables (Material Design / Google Style) */
:root {
    /* Light Theme Colors */
    --color-base: #ffffff;
    --color-contrast: #1f1f1f;
    --color-surface: #f8f9fa;
    --color-border: #dadce0;

    --color-primary: #1a73e8;
    --color-primary-hover: #174ea6;
    --color-secondary: #e8f0fe;
    --color-accent: #34a853;
    --color-warning: #fbbc04;
    --color-error: #ea4335;

    --color-text-body: #3c4043;
    --color-text-muted: #5f6368;

    /* Shadows */
    --shadow-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-2: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
    --shadow-3: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);

    /* Typography */
    --font-system: 'Inter', 'Noto Sans JP', sans-serif;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --color-base: #202124;
    --color-contrast: #e8eaed;
    --color-surface: #303134;
    --color-border: #5f6368;

    --color-primary: #8ab4f8;
    --color-primary-hover: #aecbfa;
    --color-secondary: #3c4043;

    --color-text-body: #bdc1c6;
    --color-text-muted: #9aa0a6;

    /* Dark Shadows */
    --shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.5), 0 1px 3px 1px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 1px 2px 0 rgba(0, 0, 0, 0.5), 0 2px 6px 2px rgba(0, 0, 0, 0.3);
    --shadow-3: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 4px 8px 3px rgba(0, 0, 0, 0.3);
}

/* Base Normalize & Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

img,
picture {
    width: 100%;
    display: block;
    height: auto;
}

html,
body {
    height: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: var(--font-system);
    background-color: var(--color-base);
    color: var(--color-text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

#page {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-contrast);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 800px;
}

.container-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

main {
    padding: 4rem 0;
    flex: 1 0 auto;
}

/* Header */
.site-header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-base);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    /* Fixed height for sticky calculations */
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.site-title a {
    color: var(--color-contrast);
}

.mobile-navigation {
    display: none;
}

/* Sidebar Layout */
.site-content-wrapper {
    display: flex;
    flex: 1 0 auto;
    width: 100%;
}

.site-sidebar {
    width: 250px;
    flex-shrink: 0;
    border-right: 1px solid var(--color-border);
    background-color: var(--color-base);
    position: sticky;
    top: 70px;
    /* Header height */
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

.site-main-content {
    flex-grow: 1;
    min-width: 0;
    /* Prevent flex blowout */
    display: flex;
    flex-direction: column;
}

/* Sidebar Navigation (Google Account Style) */
.sidebar-navigation {
    width: 100%;
}

.sidebar-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 1rem;
    /* Space for hover rounded corners */
}

.sidebar-nav-menu li {
    list-style: none;
}

.sidebar-nav-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--color-text-body);
    font-weight: 500;
    border-radius: 0 24px 24px 0;
    /* Google style right rounded */
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav-menu a:hover {
    background-color: var(--color-surface);
    color: var(--color-primary);
}

.sidebar-nav-menu .current-menu-item>a {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    font-weight: 600;
}

[data-theme="dark"] .sidebar-nav-menu a:hover,
[data-theme="dark"] .sidebar-nav-menu .current-menu-item>a {
    background-color: var(--color-surface);
}

/* Footer */
.site-footer {
    background-color: var(--color-surface);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-nav-menu {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.copyright {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Components */
.btn {
    display: inline-block;
    background-color: var(--color-primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.btn:hover {
    background-color: var(--color-primary-hover);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-contrast);
}

.btn-outline:hover {
    background-color: var(--color-surface);
    color: var(--color-contrast);
}

[data-theme="dark"] .btn {
    color: var(--color-base);
}

.card {
    background-color: var(--color-base);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    height: 100%;
}

.card:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Grids */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 4rem;
}

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

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

/* Responsive */
@media screen and (max-width: 992px) {
    .site-sidebar {
        display: none;
        /* Hide sidebar on smaller screens */
    }

    .mobile-navigation {
        display: block;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: 1px solid var(--color-border);
        color: var(--color-contrast);
        padding: 0.5rem 1rem;
        border-radius: 4px;
    }

    .mobile-navigation ul {
        display: none;
        /* hidden by default */
    }

    .mobile-navigation.toggled ul {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-base);
        padding: 1rem;
        border-bottom: 1px solid var(--color-border);
        z-index: 99;
    }

    .mobile-nav a {
        color: var(--color-contrast);
        font-weight: 500;
        padding: 0.5rem 0;
    }
}

/* Floating Dark Mode Toggle Button */
#theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--color-surface);
    color: var(--color-contrast);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-2);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-3);
}