/* css/style.css - Application Specific Styles */

/* Logo Styling */
.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 120px;
    /* Increased from 60px */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

/* --- Profile Page & Grid System --- */
.profile-page .grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

@media (min-width: 768px) {
    .profile-page .grid-layout {
        grid-template-columns: 1fr 1fr;
        /* 2 Column Layout on Desktop */
    }
}

.profile-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-public {
    border-top: 4px solid var(--color-accent);
}

.section-private {
    border-top: 4px solid var(--color-success);
    /* Green for secure/private */
}

/* Form Groups */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--color-text-secondary);
    font-weight: 500;
}

.geo-group {
    background-color: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    border: 1px dashed var(--border-color);
}

/* Avatars */
.image-preview {
    margin-bottom: var(--spacing-sm);
    display: flex;
    justify-content: center;
}

.avatar-big {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius-full);
    border: 3px solid var(--color-accent);
    box-shadow: var(--shadow-lg);
}

.avatar-placeholder {
    width: 150px;
    height: 150px;
    background-color: var(--color-bg-tertiary);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    border: 2px dashed var(--border-color);
}

/* Info Box */
.info-box {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--color-success);
    padding: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.code-block {
    background-color: var(--color-bg-tertiary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    font-family: monospace;
    word-break: break-all;
    user-select: all;
    /* Make easy to copy */
}

/* Login/Auth Overrides (previous code) */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    /* Minus header roughly */
    padding: var(--spacing-lg);
}

.auth-page .form-container {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.auth-page .form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
}

.auth-page h2 {
    text-align: center;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xl);
}

.auth-page label {
    display: block;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-page input {
    margin-bottom: var(--spacing-md);
    background-color: var(--color-bg-tertiary);
    border-color: transparent;
}

.auth-page input:focus {
    background-color: var(--color-bg-primary);
}

.auth-page button[type="submit"],
.btn-primary {
    width: 100%;
    background-color: var(--color-accent);
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: var(--spacing-sm);
}

.btn-secondary {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

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

.auth-page button[type="submit"]:hover,
.btn-primary:hover {
    background-color: var(--color-accent-hover);
    box-shadow: 0 0 15px var(--color-accent-glow);
    transform: translateY(-2px);
}

.auth-page p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.form-errors,
.form-success {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.9rem;
}

.form-errors {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-error);
    color: #fca5a5;
}

.form-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--color-success);
    color: #6ee7b7;
}

/* Navbar Tuning */
header {
    background-color: var(--color-bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(30, 41, 59, 0.9);
}

/* --- Lightbox / Image Viewer (Slide Up Effect) --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    /* Darker */
    z-index: 9999;
    /* Highest priority */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay.active .lightbox-content {
    transform: translateY(0);
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    /* Ensure it never crops */
    border-radius: 8px;
    border: 2px solid var(--color-accent);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10000;
}

/* Navigation & Mobile Menu */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text-primary);
    text-transform: uppercase;
    text-decoration: none;
}

nav ul {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

nav a {
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--color-accent);
}

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

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text-primary);
    border-radius: 2px;
}

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

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-bg-secondary);
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-md);
    z-index: 200;
    border: 1px solid var(--border-color);
}

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

.dropdown-content a {
    display: block;
    padding: 10px 15px;
    border-bottom: 1px solid var(--color-bg-tertiary);
}

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

/* Mobile Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-bg-secondary);
        border-bottom: 2px solid var(--color-accent);
        padding: 20px;
        flex-direction: column;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }

    nav.active {
        display: flex;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 20px;
        background: transparent;
    }
}

/* Helpers */
.text-muted {
    color: var(--color-text-muted);
}

.text-success {
    color: var(--color-success);
}

.text-sm {
    font-size: 0.85rem;
}

.mt-4 {
    margin-top: var(--spacing-xl);
}

/* --- Added Social Features Styles (Events, Messages, Search) --- */

/* Search Form */
.search-form {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

/* Event Chips & Cards (Global Fallback) */
.user-chip {
    display: inline-flex;
    align-items: center;
    background: var(--color-bg-tertiary);
    border-radius: 20px;
    padding: 2px 10px 2px 2px;
    margin: 2px;
    font-size: 0.85rem;
    color: var(--color-text-primary);
    text-decoration: none;
}

.user-chip img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 6px;
}

/* Chat Bubbles (Shared) */
.message-bubble {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 12px;
    margin-bottom: var(--spacing-xs);
    max-width: 80%;
}

.message-sent {
    background-color: var(--color-accent);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.message-received {
    background-color: var(--color-bg-tertiary);
    margin-right: auto;
    border-bottom-left-radius: 2px;
}


/* --- Fixes & Premium Refinements --- */

/* Chat UI Fix - Robust Layout */
.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background: var(--color-bg-secondary);
}

.message-container {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 20px;
    min-height: 0;
    /* Crucial for flex scrolling */
}

.chat-input-area {
    flex: 0 0 auto;
    width: 100%;
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 15px;
    z-index: 100;
    /* Ensure on top */
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    /* Force visibility */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.chat-input-area input {
    margin-bottom: 0;
    flex-grow: 1;
    /* Take up space */
    height: 40px;
    /* Force height */
}

.chat-input-area .btn-primary {
    width: auto;
    margin-top: 0;
    padding: 0 25px;
    border-radius: 25px;
    height: 100%;
}

/* Premium Dark Theme Overrides */
:root {
    --color-bg-primary: #0a0a0a;
    --color-bg-secondary: #0f1012;
    --color-bg-tertiary: #1a1b1e;

    /* Aberlos x FLCD Fusion Colors */
    --color-accent: #d4af37;
    /* Premium Gold */
    --color-accent-hover: #b8860b;
    --color-accent-glow: rgba(212, 175, 55, 0.5);

    --color-text-primary: #ffffff;
    --color-text-secondary: #a0a0a0;
}

/* Mascot Container in Footer */
.mascot-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Align at bottom/feet */
    gap: 20px;
    margin-bottom: 30px;
    opacity: 1;
    flex-wrap: wrap;
}

.mascot-img {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.2));
    transition: all 0.3s ease;
}

.mascot-img:hover {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
}

/* Specific Mascot Sizes/Adjustments for visual balance */
.mascot-img[alt*="Rubber Master"] {
    height: 85px;
    /* Master is tall */
}

/* Specific Mascot Sizes/Adjustments for visual balance */
.mascot-img[alt*="Puppy"] {
    height: 70px;
}

/* --- Improved Footer Layout --- */
.main-footer {
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        text-align: left;
    }

    .mascot-container {
        justify-content: flex-start;
    }
}

.footer-col h4 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: var(--color-text-muted);
}

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

.text-xs {
    font-size: 1.3rem;
    position: relative;
    z-index: 2;
}

/* Action Box Grid Layout */
.action-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    /* Hardcoded safe value */
    margin-top: 1.5rem;
}

.action-box {
    background: var(--color-bg-tertiary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.action-box:hover {
    transform: translateY(-5px);
    border-color: var(--color-accent);
}

.action-box p {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 2;
    flex-grow: 1;
}

.action-box-mascot {
    position: absolute;
    bottom: -10px;
    right: -10px;
    height: 120px;
    opacity: 0.8;
    transition: all 0.4s ease;
    z-index: 1;
}

.action-box:hover .action-box-mascot {
    transform: scale(1.1) rotate(5deg);
    opacity: 1;
}

/* New Mascot Wrapper for Captions */
.mascot-wrapper {
    position: absolute;
    bottom: -10px;
    right: -10px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.action-box-mascot {
    /* Reset absolute positioning as wrapper handles it */
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    height: 120px;
    opacity: 0.8;
    transition: all 0.4s ease;
}

.mascot-caption {
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-right: 10px;
    margin-bottom: 5px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
    /* Let clicks pass to image */
}

.action-box:hover .mascot-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Color Variants */
.action-box.box-security {
    border-top: 4px solid var(--color-success);
}

.action-box.box-security .action-box-mascot {
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.3));
}

.action-box.box-community {
    border-top: 4px solid var(--color-accent);
}

.action-box.box-community .action-box-mascot {
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

.action-box.box-tech {
    border-top: 4px solid #8b5cf6;
    /* Violet */
}

.action-box.box-tech .action-box-mascot {
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
}