/* =====================
   eCalculus - Main Styles
   ===================== */

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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;

    --bg-color: #f8fafc;
    --bg-white: #ffffff;
    --bg-light: #f1f5f9;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

    --container-width: 1200px;
    --header-height: 64px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

/* Header */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav {
    height: var(--header-height);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo:hover {
    color: var(--primary-color);
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

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

.nav-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
}

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

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem 0;
    list-style: none;
    z-index: 50;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

.dropdown-menu a:hover {
    background: var(--bg-light);
}

/* Language Switcher */
.language-switcher {
    position: relative;
}

.current-lang {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.current-lang:hover {
    background: var(--bg-color);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    list-style: none;
    z-index: 50;
}

.lang-dropdown.show {
    display: block;
}

.lang-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

.lang-dropdown a:hover {
    background: var(--bg-light);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

/* Footer */
.site-footer {
    background: var(--text-primary);
    color: var(--bg-light);
    padding: 3rem 1rem 1rem;
    margin-top: auto;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--bg-white);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer-section a:hover {
    color: var(--bg-white);
}

.footer-section p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.footer-bottom {
    max-width: var(--container-width);
    margin: 0 auto;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

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

.btn-copy {
    background: var(--bg-light);
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.btn-copy:hover {
    background: var(--bg-color);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--text-secondary);
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }
}
