/* ================================================
   AllWayShalom - Complete Design System
   ================================================ */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Brand Colors */
    --brand-dark: #3E2723;
    --brand-medium: #5D4037;
    --brand-light: #8D6E63;
    --accent-green: #7A9B4F;
    --accent-green-hover: #6B8A42;
    --accent-green-light: #E8F0DC;

    /* Background Colors */
    --bg-cream: #FFF8E1;
    --bg-beige: #EFEBE9;
    --bg-lightbeige: #F8F5F2;
    --bg-white: #FFFFFF;

    /* Text Colors */
    --text-primary: #3E2723;
    --text-secondary: #5D4037;
    --text-muted: #6B6B6B;
    --text-light: #8D6E63;
    --text-white: #FFFFFF;

    /* Status Colors */
    --success: #4CAF50;
    --warning: #FFC107;
    --error: #E53935;
    --info: #2196F3;

    /* Border & Shadow */
    --border-color: #E8E5E2;
    --border-light: #F0EDE9;
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Rating */
    --star-color: #FFC107;
    --star-empty: #E0E0E0;

    /* Spacing */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;

    /* Layout */
    --header-height: 80px;
    --sidebar-width: 280px;
    --container-max: 1400px;
    --container-narrow: 800px;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-green);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--brand-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* ==================== UTILITY CLASSES ==================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 24px;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-green); }
.text-white { color: var(--text-white); }

.bg-white { background-color: var(--bg-white); }
.bg-cream { background-color: var(--bg-cream); }
.bg-beige { background-color: var(--bg-beige); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-green);
    color: var(--text-white);
    border-color: var(--accent-green);
}

.btn-primary:hover {
    background: var(--accent-green-hover);
    border-color: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-white);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--brand-dark);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--brand-dark);
    background: var(--bg-beige);
    color: var(--brand-dark);
}

.btn-dark {
    background: var(--brand-dark);
    color: var(--text-white);
    border-color: var(--brand-dark);
}

.btn-dark:hover {
    background: var(--brand-medium);
    border-color: var(--brand-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-white);
}

.btn-outline {
    background: transparent;
    color: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-outline:hover {
    background: var(--brand-dark);
    color: var(--text-white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-beige);
    color: var(--brand-dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
}

.btn-icon.btn-sm {
    width: 36px;
    height: 36px;
}

.btn-block {
    width: 100%;
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-dark);
    box-shadow: 0 0 0 3px rgba(62, 39, 35, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235D4037' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input,
.form-radio input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-green);
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 6px;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--bg-lightbeige);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-text {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 16px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--accent-green);
    color: var(--text-white);
}

.badge-secondary {
    background: var(--bg-beige);
    color: var(--brand-dark);
}

.badge-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-warning {
    background: #FFF8E1;
    color: #F57F17;
}

.badge-error {
    background: #FFEBEE;
    color: #C62828;
}

.badge-dark {
    background: var(--brand-dark);
    color: var(--text-white);
}

/* ==================== RATING STARS ==================== */
.stars {
    display: inline-flex;
    gap: 2px;
}

.star {
    width: 16px;
    height: 16px;
    background: var(--star-empty);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.star.filled {
    background: var(--star-color);
}

.star.half {
    background: linear-gradient(90deg, var(--star-color) 50%, var(--star-empty) 50%);
}

.stars-sm .star {
    width: 14px;
    height: 14px;
}

.stars-lg .star {
    width: 20px;
    height: 20px;
}

.rating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rating-value {
    font-weight: 600;
    color: var(--brand-dark);
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==================== AVATAR ==================== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-beige);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
}

.avatar-xl {
    width: 80px;
    height: 80px;
}

/* ==================== HEADER ==================== */
.site-header {
    background: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--accent-green);
    box-shadow: var(--shadow-xs);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    height: 48px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    margin: 0 40px;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 10px 20px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--brand-dark);
    background: var(--bg-beige);
}

.nav-link.active {
    color: var(--text-white);
    background: var(--brand-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
}

.header-icon:hover {
    background: var(--bg-beige);
    color: var(--brand-dark);
}

.header-icon .badge-count {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--accent-green);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--brand-dark);
    transition: all var(--transition);
}

/* ==================== FOOTER ==================== */
.site-footer {
    background: linear-gradient(135deg, var(--brand-dark) 0%, #2D1B18 100%);
    color: var(--bg-beige);
    margin-top: 80px;
}

.footer-main {
    padding: 60px 0 40px;
}

.footer-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 48px;
}

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-brand .logo img {
    filter: brightness(0) invert(1);
}

.footer-description {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--brand-light);
    margin-bottom: 24px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: var(--bg-beige);
    transition: all var(--transition);
}

.social-link:hover {
    background: var(--accent-green);
    color: white;
    transform: translateY(-3px);
}

.footer-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 20px;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--brand-light);
    font-size: 0.9375rem;
    transition: all var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 4px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 0.9375rem;
    color: var(--brand-light);
}

.footer-contact svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--accent-green);
}

.footer-contact a:hover {
    color: white;
}

.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    font-size: 0.875rem;
    color: var(--brand-light);
}

.legal-links {
    display: flex;
    gap: 24px;
}

.legal-links a {
    font-size: 0.875rem;
    color: var(--brand-light);
}

.legal-links a:hover {
    color: white;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 24px);
    height: fit-content;
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
}

.sidebar-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-beige);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition);
}

.category-link:hover {
    background: var(--bg-beige);
    color: var(--brand-dark);
    padding-left: 16px;
}

.category-link.active {
    background: var(--brand-dark);
    color: white;
}

.category-count {
    font-size: 0.8125rem;
    color: var(--text-light);
    background: var(--bg-beige);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.category-link.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.page-link {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.page-link:hover:not(.disabled):not(.active) {
    border-color: var(--brand-dark);
    color: var(--brand-dark);
}

.page-link.active {
    background: var(--brand-dark);
    color: white;
    border-color: var(--brand-dark);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    color: var(--text-light);
    padding: 0 8px;
}

/* ==================== ICONS ==================== */
.icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

.icon-sm {
    width: 18px;
    height: 18px;
}

.icon-lg {
    width: 32px;
    height: 32px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    :root {
        --header-height: 70px;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        padding: 20px;
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--border-color);
    }

    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .logo img {
        height: 40px;
    }

    .header-actions .btn {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .container {
        padding: 0 16px;
    }
}

@media (max-width: 544px) {
    .pagination {
        flex-wrap: wrap;
    }

    .page-link {
        min-width: 40px;
        height: 40px;
    }

    .header-container {
        padding: 0 12px;
    }

    .header-actions {
        gap: 8px;
    }

    .header-icon {
        padding: 8px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* Extra small screens */
@media (max-width: 375px) {
    .logo img {
        height: 32px;
    }

    .header-actions .header-icon:not(:first-child):not(:last-child) {
        display: none;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
}
