/**
 * OmniBazaar Template Styles
 * Consistent styles for header and footer across all pages
 */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #373373;
    --primary-dark: #2a2858;
    --primary-light: #4a46a3;
    --background: #F7F8FA;
    --surface: #FFFFFF;
    --text-primary: #3E4153;
    --text-secondary: #6F727F;
    --text-muted: #8E909B;
    --border: #E5E7EB;
    --hover: #F3F4F6;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --spacing-unit: 0.8rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark theme */
[data-theme="dark"] {
    --background: #1a1b26;
    --surface: #24283b;
    --text-primary: #c0caf5;
    --text-secondary: #9aa5ce;
    --text-muted: #565f89;
    --border: #414868;
    --hover: #292e42;
}

html {
    font-size: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: var(--surface);
    border-top: 0.5rem solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 144rem;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.brand-link:hover {
    color: var(--primary-dark);
}

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

.logo-img {
    height: 3.2rem;
    width: auto;
}

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

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 2.4rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.4rem;
    padding: 0.8rem 0.4rem;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
    text-decoration: underline;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
}

.search-input {
    padding: 0.8rem 3.2rem 0.8rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1.4rem;
    min-width: 20rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-button {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.icon-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.6rem;
    min-width: 4rem;
    height: 4rem;
    text-decoration: none;
}

.icon-button:hover {
    background-color: var(--hover);
    border-color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    background: var(--error);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 50%;
    min-width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-button {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.4rem;
}

.dropdown-button:hover {
    background-color: var(--hover);
    border-color: var(--primary-color);
}

.profile-button {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.2rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.4rem;
}

.profile-button:hover {
    background-color: var(--hover);
    border-color: var(--primary-color);
}

.profile-avatar {
    font-size: 1.8rem;
}

.profile-name {
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 0.8rem;
    opacity: 0.6;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    box-shadow: var(--shadow-lg);
    min-width: 18rem;
    z-index: 1000;
    margin-top: 0.4rem;
}

.dropdown-item {
    display: block;
    padding: 1.2rem 1.6rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.4rem;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--hover);
    color: var(--primary-color);
}

/* Main Content */
.main {
    flex: 1;
    max-width: 144rem;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

/* Footer Styles */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 144rem;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 15rem;
}

.footer-title {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

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

.footer-links li {
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.2s;
}

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

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo-section {
    text-align: center;
    margin-bottom: 0.5rem;
}

.footer-logo {
    height: 3.75rem;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.4;
    margin: 0;
    text-align: center;
    max-width: 80ch;
}

/* Common Page Styles */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.8rem;
    color: var(--text-secondary);
}

/* Content Container */
.content-container {
    background: var(--surface);
    border-radius: 1.2rem;
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

/* Button Styles */
.btn {
    padding: 1.2rem 2.4rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-0.2rem);
}

.btn-secondary {
    background: var(--surface);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--hover);
    transform: translateY(-0.2rem);
}


/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-menu {
        display: none;
    }

    .search-container {
        order: 3;
        flex: 1 1 100%;
    }

    .search-input {
        width: 100%;
        min-width: auto;
    }

    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
        gap: 2rem;
    }

    .page-title {
        font-size: 3rem;
    }

    .content-container {
        padding: 2rem;
    }
}