/* CSS Custom Properties */
:root {
    --brown-primary: #6B3A2A;
    --brown-hover: #5a3022;
    --brown-light: #8B5A4A;
    --gold-gradient-start: #C4873B;
    --gold-gradient-end: #9C6F48;

    --bg-light: #F5F5F5;
    --bg-white: #FFFFFF;
    --text-dark: #1a1a1a;
    --text-medium: #666666;
    --text-light: #999999;

    --border-light: #E5E7EB;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==============================
   Legacy auth page elements (kept for allauth templates)
   ============================== */

/* ==============================
   Messages / Alerts
   ============================== */
.messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error, .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ==============================
   Dashboard Home Page
   ============================== */
.dashboard-home {
    max-width: 1100px;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #6B3A2A, #a0522d);
    color: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.welcome-banner-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.25rem;
}

.welcome-banner-subheading {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}

/* ==============================
   Promotional Banner Carousel
   ============================== */
.promo-carousel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    height: 320px;
    user-select: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.promo-carousel-track {
    position: relative;
    height: 100%;
}

.promo-slide {
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* off-screen right by default; JS/active class override this */
    transform: translateX(100%);
}

.promo-slide.active {
    transform: translateX(0);
    pointer-events: auto;
}

.promo-slide.is-transitioning {
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.promo-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.promo-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--brown-primary);
}

.promo-slide-gradient {
    background-color: var(--brown-primary);
}

.promo-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.70),
        rgba(0, 0, 0, 0.50) 50%,
        transparent
    );
}

.promo-slide-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 3rem;
    max-width: 600px;
}

.promo-title {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    line-height: 1.25;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.promo-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0 0 1.5rem;
    line-height: 1.55;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.promo-cta {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background-color: #fff;
    color: var(--brown-primary);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    align-self: flex-start;
    transition: background-color 0.2s;
}

.promo-cta:hover {
    background-color: var(--bg-light);
    color: var(--brown-hover);
}

/* Nav arrows — hidden until hover */
.promo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    backdrop-filter: blur(4px);
}

.promo-carousel:hover .promo-nav {
    opacity: 1;
}

.promo-nav:hover {
    background: rgba(255, 255, 255, 0.35);
}

.promo-prev { left: 1rem; }
.promo-next { right: 1rem; }

/* Dot indicators — inactive = small circle, active = wide pill */
.promo-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    align-items: center;
    z-index: 10;
}

.promo-dot {
    height: 8px;
    width: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.promo-dot.active {
    width: 32px;
    background: #fff;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.35rem;
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
}

.view-all-btn {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    transition: all 0.2s;
}

.view-all-btn:hover {
    border-color: var(--brown-primary);
    color: var(--brown-primary);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.blog-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.3s;
}

.blog-card:hover {
    box-shadow: var(--shadow-hover);
}

.blog-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--bg-light);
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-content {
    padding: 1.25rem;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.blog-category {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.blog-category.business {
    background-color: rgba(107, 58, 42, 0.1);
    color: var(--brown-primary);
}

.blog-category.technology {
    background-color: rgba(74, 93, 124, 0.1);
    color: #4A5D7C;
}

.blog-read-time {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.blog-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.blog-excerpt {
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.blog-author {
    font-size: 0.85rem;
    color: var(--text-light);
}

.read-more {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}

.read-more:hover {
    color: var(--brown-primary);
}

/* ==============================
   Auth Pages
   ============================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 440px;
}

.auth-card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: #1a1a2e;
}

.auth-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Forms */
.auth-card div > div {
    margin-bottom: 1rem;
}

.auth-card label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #444;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card select,
.auth-card textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
    outline: none;
    border-color: var(--brown-primary);
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: var(--brown-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.3s;
    text-decoration: none;
    display: block;
    text-align: center;
}

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

.btn-secondary {
    padding: 0.8rem 1.5rem;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-medium);
}

/* Social Login */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.divider span {
    background: #fff;
    padding: 0 0.75rem;
    color: #999;
    font-size: 0.85rem;
}

.social-login {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.social-btn:hover {
    background: #f5f5f5;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.auth-links a {
    color: var(--brown-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ==============================
   Profile Page
   ============================== */
.profile-container {
    max-width: 600px;
    margin: 2rem auto;
}

.profile-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #999;
}

.profile-info h1 {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-general {
    background: #d1ecf1;
    color: #0c5460;
}

.role-business {
    background: #fff3cd;
    color: #856404;
}

.role-admin {
    background: #f8d7da;
    color: #721c24;
}

.profile-details {
    margin-bottom: 1.5rem;
}

.detail-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    color: #444;
    margin-right: 0.5rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
}

.profile-actions .btn-primary {
    width: auto;
    padding: 0.8rem 1.5rem;
}

/* Form Error Lists */
.auth-card .errorlist {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0;
}

.auth-card .errorlist li {
    color: var(--brown-primary);
    font-size: 0.85rem;
}

/* Home Page (legacy, keep for non-dashboard uses) */
.home-container {
    text-align: center;
    padding: 3rem 1rem;
}

.home-container h1 {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

/* ==============================
   Profile Edit & View Pages
   ============================== */
.profile-edit-container {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.profile-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.profile-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.profile-section-subtitle {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Avatar Section */
.avatar-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.avatar-circle-wrapper {
    position: relative;
    flex-shrink: 0;
}

.avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--brown-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle.avatar-img {
    object-fit: cover;
}

.avatar-initials {
    color: #fff;
    font-size: 2rem;
    font-weight: 600;
    text-transform: uppercase;
}

.avatar-camera-icon {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    background: var(--text-dark);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 2px solid var(--bg-white);
}

.avatar-upload-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.25rem;
}

.avatar-upload-info p {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin: 0 0 0.75rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 0.5rem;
}

.form-label-note {
    font-weight: 400;
    color: var(--text-light);
    font-style: italic;
}

.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--brown-primary);
    background-color: var(--bg-white);
}

.form-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.35rem;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.35rem;
    text-align: right;
}

/* Social Label with Icon */
.social-label i {
    margin-right: 0.25rem;
    width: 16px;
    text-align: center;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.5rem;
}

.form-actions .btn-secondary {
    padding: 0.7rem 1.5rem;
}

.form-actions-save {
    width: auto !important;
    padding: 0.7rem 1.5rem !important;
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
}

/* Field Errors */
.field-errors {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

.field-errors li {
    color: #DC2626;
    font-size: 0.8rem;
}

/* Profile View Values */
.profile-view-value {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin: 0;
    padding: 0.7rem 1rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.profile-view-empty {
    font-size: 0.95rem;
    color: var(--text-light);
    font-style: italic;
    margin: 0;
    padding: 0.7rem 1rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

/* ==============================
   Responsive Design
   ============================== */
@media (max-width: 768px) {
    .promo-carousel {
        height: 256px;
    }

    .promo-slide-content {
        padding: 1.5rem 2rem;
    }

    .promo-title {
        font-size: 1.3rem;
    }

    .promo-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }

    /* Always show nav arrows on touch devices */
    .promo-nav {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .auth-card {
        margin: 1rem;
        padding: 1.5rem;
    }

    .social-login {
        flex-direction: column;
    }

    .navbar-brand-text {
        display: none;
    }

    .profile-actions {
        flex-direction: column;
    }
}

/* ===== Home Page — Blog Grid ===== */
.blog-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 2rem;
}

/* ===== Saved Items Page ===== */
.saved-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brown-primary);
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.4rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}


/* =====================================================
   Mobile — inline search bar (shown within pages)
   ===================================================== */

.mobile-search-bar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-search-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #f5f5f4;
        border-radius: 16px;
        padding: 10px 14px;
        margin-bottom: 1rem;
    }

    .mobile-search-bar i {
        color: #9ca3af;
        font-size: 14px;
        flex-shrink: 0;
    }

    .mobile-search-bar input {
        flex: 1;
        background: transparent;
        border: none;
        outline: none;
        font-size: 14px;
        color: #374151;
    }

    .mobile-search-bar input::placeholder {
        color: #9ca3af;
    }

    /* Blog grid — horizontal scroll on mobile home */
    .blog-grid.blog-scroll-mobile {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 12px;
        padding-bottom: 4px;
        margin-right: -1rem;
        padding-right: 1rem;
    }

    .blog-grid.blog-scroll-mobile::-webkit-scrollbar {
        display: none;
    }

    .blog-grid.blog-scroll-mobile .blog-card {
        flex-shrink: 0;
        width: 192px;
        min-width: 192px;
    }

    /* Event date badge for mobile home */
    .event-home-card .event-date-badge {
        display: flex;
    }
}

/* Event date badge */
.event-date-badge {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-width: 48px;
    height: 56px;
    border-radius: 12px;
    background: #78350f;
    color: #fff;
    flex-shrink: 0;
}

.event-date-badge .event-badge-month {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.85;
    text-transform: uppercase;
    line-height: 1;
}

.event-date-badge .event-badge-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}


/* ── Focal Point Picker ─────────────────────────────────────────────────── */

.focal-point-wrap {
    display: none;
    margin-top: 0.75rem;
}

.focal-point-wrap--active {
    display: block;
}

.focal-point-hint {
    margin-bottom: 0.5rem;
}

.focal-point-preview-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    cursor: crosshair;
    border-radius: 6px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.focal-point-preview-img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    pointer-events: none;
}

.focal-point-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: left 0.05s, top 0.05s;
    background: rgba(255, 255, 255, 0.15);
}
