/**
 * The Brewentists Cafe - Main Stylesheet
 * Designed & Developed by The AI Nexus Ltd
 * Website: www.theainexus.co.uk
 * Support: support@theainexus.co.uk
 */

/* ========================================
   IMPORTS & FONTS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600&display=swap');

/* ========================================
   CSS VARIABLES & DESIGN TOKENS
   ======================================== */
:root {
    /* Color Palette */
    --color-primary: #6F4E37;
    --color-primary-dark: #5a3d2b;
    --color-primary-light: #8b6347;
    --color-secondary: #F5E6D3;
    --color-accent: #D4A574;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-success: #28a745;
    --color-error: #dc3545;
    --color-warning: #ffc107;
    --color-info: #17a2b8;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6F4E37 0%, #8b6347 100%);
    --gradient-accent: linear-gradient(135deg, #D4A574 0%, #b8895f 100%);
    --gradient-overlay: linear-gradient(135deg, rgba(111, 78, 55, 0.9) 0%, rgba(139, 99, 71, 0.8) 100%);

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-accent: 'Outfit', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-light);
}

.text-accent {
    font-family: var(--font-accent);
}

/* ========================================
   LAYOUT & CONTAINERS
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-2xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title h2 {
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition-base);
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 1.25rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-link {
    color: var(--color-text);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.nav-link:hover {
    color: var(--color-primary);
    background: var(--color-secondary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    overflow: hidden;
    margin-top: 70px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/cafe_hero_background.jpg') center/cover no-repeat;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-overlay);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    padding: var(--spacing-md);
    animation: fadeInUp 1s ease;
}

.hero h1 {
    color: var(--color-white);
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xl);
    color: var(--color-secondary);
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    margin-top: var(--spacing-lg);
    font-weight: 600;
}

.stars {
    color: #FFD700;
    font-size: 1.25rem;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-base);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: var(--spacing-md);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.card-text {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    background: var(--color-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(111, 78, 55, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
}

.form-error {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    display: none;
}

.form-group.error .form-control {
    border-color: var(--color-error);
}

.form-group.error .form-error {
    display: block;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ========================================
   REVIEWS SECTION
   ======================================== */
.review-card {
    background: var(--color-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--color-accent);
}

.review-stars {
    color: #FFD700;
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.review-text {
    font-style: italic;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.review-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--color-primary);
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.reviewer-info {
    flex: 1;
}

.reviewer-name {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 2px;
}

.reviewer-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: 400;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
}

.footer-section p,
.footer-section a {
    color: var(--color-secondary);
    margin-bottom: var(--spacing-xs);
}

.footer-section a:hover {
    color: var(--color-white);
}

.footer-bottom {
    border-top: 1px solid rgba(245, 230, 211, 0.2);
    padding-top: var(--spacing-md);
    text-align: center;
    color: var(--color-white);
    /* Changed from var(--color-secondary) for better visibility */
}

.developer-credit {
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--color-white);
    /* Ensure developer credit is also white */
}

.developer-credit a {
    color: var(--color-accent);
    /* Bright accent color for links */
    font-weight: 600;
    text-decoration: none;
}

.developer-credit a:hover {
    color: #FFD700;
    /* Gold color on hover for better visibility */
    text-decoration: underline;
}

/* Social Media Icons */
.social-links {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: 1.125rem;
    transition: var(--transition-base);
}

.social-icon:hover {
    background: var(--color-accent);
    color: var(--color-white);
    transform: translateY(-3px);
}

/* ========================================
   AI CHATBOT WIDGET
   ======================================== */

/* Chat Toggle Button */
#chatToggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-white);
    border: none;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 999;
    transition: var(--transition-base);
}

#chatToggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(111, 78, 55, 0.4);
}

/* Chat Widget */
#chatWidget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    z-index: 998;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
}

#chatWidget.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.chat-title h4 {
    margin: 0;
    font-size: 1rem;
}

.chat-status {
    font-size: 0.75rem;
    opacity: 0.9;
}

.chat-status::before {
    content: '●';
    color: #4ade80;
    margin-right: 5px;
}

#chatClose {
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: var(--transition-base);
}

#chatClose:hover {
    opacity: 1;
}

/* Chat Messages */
#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    background: #f9fafb;
}

.chat-message {
    margin-bottom: var(--spacing-md);
    animation: fadeInUp 0.3s ease;
}

.user-message {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-message .message-content {
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md) var(--radius-md) 0 var(--radius-md);
    max-width: 75%;
    word-wrap: break-word;
}

.bot-message {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.message-wrapper {
    flex: 1;
}

.bot-message .message-content {
    background: var(--color-white);
    color: var(--color-text);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-width: 85%;
}

.message-time {
    font-size: 0.7rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

.chat-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
}

.chat-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-white);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-light);
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Chat Input */
.chat-input {
    padding: var(--spacing-md);
    border-top: 1px solid #e5e7eb;
    background: var(--color-white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.chat-input-wrapper {
    display: flex;
    gap: var(--spacing-sm);
}

#chatInput {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    resize: none;
    max-height: 100px;
}

#chatInput:focus {
    outline: none;
    border-color: var(--color-primary);
}

#chatSend {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-base);
}

#chatSend:hover {
    background: var(--color-accent);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #chatWidget {
        width: calc(100% - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 80px;
    }

    #chatToggle {
        bottom: 20px;
        right: 20px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--color-white);
        flex-direction: column;
        padding: var(--spacing-xl);
        transition: var(--transition-base);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .section {
        padding: var(--spacing-xl) 0;
    }
}