/* 
   Main Site Integration CSS for Gallery
   This file bridges main site theming with gallery-specific needs
   
   Purpose:
   1. Adapt main site CSS variables and classes for gallery use
   2. Override gallery-specific elements while preserving main site feel
   3. Ensure consistent typography, colors, and spacing
*/

/* =================================
   MAIN SITE THEMING INTEGRATION
   ================================= */

/* Ensure main site body styles apply to gallery */
body {
    /* Inherit main site styling from main.css */
    font-family: 'Georgia', serif !important;
    background-color: #f9f7f4 !important;
    background-image: linear-gradient(to bottom, #f9f7f4, #f0ece6) !important;
    color: #333 !important;
    line-height: 1.6;
}

/* Gallery-specific header styling that matches main site */
.gallery-header-wrapper {
    background-color: transparent;
    padding: 20px 0;
}

.nav-back {
    color: #5D4777;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: inline-block;
    transition: color 0.3s;
}

.nav-back:hover {
    color: #7e62a1;
    text-decoration: underline;
}

.gallery-header {
    text-align: center;
    padding: 20px 0;
}

.gallery-title {
    font-size: 2.5rem;
    color: #5D4777 !important;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.gallery-subtitle {
    color: #666 !important;
    font-style: italic;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* =================================
   USER CONTEXT BAR STYLING
   ================================= */

.user-context-bar {
    background: linear-gradient(135deg, #5D4777 0%, #6e5a8a 100%);
    color: white;
    padding: 12px 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.access-info {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    text-align: center;
}

.access-info .status {
    font-weight: bold;
    font-size: 1rem;
}

.access-info .limits,
.access-info .benefits {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-upgrade {
    background-color: #d4af37;
    color: #333;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-upgrade:hover {
    background-color: #e0bc45;
    transform: translateY(-1px);
}

/* Override container behavior in user context bar */
.user-context-bar .container {
    text-align: center;
}

/* Ensure access-info centers its content */
.user-context-bar .access-info {
    justify-content: center !important;
    text-align: center;
}

.user-context-bar .access-info .status,
.user-context-bar .access-info .benefits {
    text-align: center;
}

/* =================================
   GALLERY CONTENT STYLING
   ================================= */

.gallery-main {
    min-height: 60vh;
    padding: 20px 0;
}

/* Gallery Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
/* =================================
   GALLERY CSS INTEGRATION OVERRIDES
   
   Purpose: Override gallery.css, tags.css, favorites.css
   to match main site theming while preserving functionality
   ================================= */

/* Override gallery.css container and layout */
.container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    /* Inherits main site container behavior */
}

/* Override gallery.css header styling */
.header h1 {
    color: #5D4777 !important;
    font-family: 'Georgia', serif !important;
    font-size: 2.5rem !important;
    letter-spacing: 1px !important;
    margin-bottom: 10px !important;
}

/* Override gallery.css button styling to match main site */
.btn-primary {
    background-color: #d4af37 !important;
    color: #333 !important;
    padding: 12px 24px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
    font-size: 1rem !important;
    transition: all 0.3s !important;
    border: none !important;
    font-family: 'Georgia', serif !important;
}

.btn-primary:hover {
    background-color: #e0bc45 !important;
    transform: translateY(-2px) !important;
    color: #333 !important;
}

.btn-secondary {
    background-color: #5D4777 !important;
    color: white !important;
    padding: 12px 24px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
    border: none !important;
    font-family: 'Georgia', serif !important;
}

.btn-secondary:hover {
    background-color: #7e62a1 !important;
    transform: translateY(-2px) !important;
    color: white !important;
}

/* Override gallery.css image cards to match main site aesthetic */
.image-card {
    background-color: white !important;
    border: 2px solid #e1ddd2 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    transition: all 0.3s ease !important;
}

.image-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15) !important;
    border-color: #5D4777 !important;
}

/* Override gallery.css form elements */
.filter-select, 
input[type="text"], 
input[type="search"],
select {
    padding: 8px 12px !important;
    border: 2px solid #e1ddd2 !important;
    border-radius: 5px !important;
    font-family: 'Georgia', serif !important;
    font-size: 1rem !important;
    background-color: white !important;
    color: #333 !important;
    transition: border-color 0.3s !important;
}

.filter-select:focus, 
input[type="text"]:focus, 
input[type="search"]:focus,
select:focus {
    outline: none !important;
    border-color: #5D4777 !important;
    box-shadow: 0 0 0 2px rgba(93, 71, 119, 0.1) !important;
}

/* Override gallery.css filter controls */
.filters {
    background-color: white !important;
    border: 2px solid #e1ddd2 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Override gallery.css link colors */
.title-link,
.breadcrumb a,
.nav-button {
    color: #5D4777 !important;
    transition: color 0.3s !important;
}

.title-link:hover,
.breadcrumb a:hover {
    color: #7e62a1 !important;
}

/* Override navigation buttons */
.nav-button {
    background-color: #5D4777 !important;
    color: white !important;
    border-radius: 5px !important;
    font-family: 'Georgia', serif !important;
    font-weight: bold !important;
}

.nav-button:hover {
    background-color: #7e62a1 !important;
    transform: translateY(-2px) !important;
}

.nav-button.gallery {
    background-color: #d4af37 !important;
    color: #333 !important;
}

.nav-button.gallery:hover {
    background-color: #e0bc45 !important;
    color: #333 !important;
}

/* =================================
   TAG SYSTEM INTEGRATION
   Override tags.css to match main site theming
   ================================= */

/* Main tag color adjustments to work with purple theme */
.tag-character { 
    background-color: #5D4777 !important; 
    color: white !important; 
}

.tag-species { 
    background-color: #d4af37 !important; 
    color: #333 !important; 
}

.tag-book { 
    background-color: #7e62a1 !important; 
    color: white !important; 
}

.tag-wiki { 
    background-color: #463358 !important; 
    color: white !important; 
}

/* Tag hover effects matching main site */
.tag:hover,
.tag.tag-hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(93, 71, 119, 0.3) !important;
}

/* Filter bar integration */
.filter-bar {
    background-color: white !important;
    border: 2px solid #e1ddd2 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Add tag button integration */
.add-tag-btn {
    border: 2px dashed #5D4777 !important;
    color: #5D4777 !important;
    background-color: white !important;
}

.add-tag-btn:hover {
    background-color: #f9f7f4 !important;
    border-color: #7e62a1 !important;
    transform: translateY(-2px) !important;
}

/* Tag dropdown styling */
.add-tag-dropdown {
    border-color: #5D4777 !important;
    box-shadow: 0 8px 32px rgba(93, 71, 119, 0.3) !important;
}

.add-tag-submit {
    background-color: #5D4777 !important;
    font-family: 'Georgia', serif !important;
    font-weight: bold !important;
}

.add-tag-submit:hover {
    background-color: #7e62a1 !important;
    transform: translateY(-1px) !important;
}

.add-tag-cancel {
    border-color: #e1ddd2 !important;
    font-family: 'Georgia', serif !important;
}

/* =================================
   FAVORITES SYSTEM INTEGRATION
   Override favorites.css to match main site theming
   ================================= */

/* Favorite button color scheme */
.favorite-btn-inline {
    border-color: #e1ddd2 !important;
    color: #5D4777 !important;
    font-family: 'Georgia', serif !important;
}

.favorite-btn-inline:hover {
    border-color: #d4af37 !important;
    color: #d4af37 !important;
    background-color: #f9f7f4 !important;
}

.favorite-btn-inline.favorited {
    background-color: #d4af37 !important;
    border-color: #d4af37 !important;
    color: #333 !important;
}

.favorite-btn-inline.favorited:hover {
    background-color: #e0bc45 !important;
    border-color: #e0bc45 !important;
    color: #333 !important;
}

/* Notification styling */
.favorite-notification.success {
    background-color: #d4f4dd !important;
    color: #155724 !important;
    border-color: #c3e6cb !important;
}

/* User info bar styling */
.user-info-bar {
    background-color: white !important;
    border: 2px solid #e1ddd2 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.user-greeting {
    color: #5D4777 !important;
    font-family: 'Georgia', serif !important;
}

/* Empty state styling */
.empty-state {
    background-color: white !important;
    border: 2px solid #e1ddd2 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.empty-state h2 {
    color: #5D4777 !important;
    font-family: 'Georgia', serif !important;
}

/* =================================
   PAGINATION INTEGRATION
   Override gallery.css pagination to match main site
   ================================= */

.pagination .page-btn {
    color: #5D4777 !important;
    border: 2px solid #e1ddd2 !important;
    border-radius: 5px !important;
    font-family: 'Georgia', serif !important;
    background-color: white !important;
}

.pagination .page-btn:hover {
    background-color: #5D4777 !important;
    color: white !important;
    border-color: #5D4777 !important;
    transform: translateY(-1px) !important;
}

.pagination .page-btn.current {
    background-color: #5D4777 !important;
    color: white !important;
    border-color: #5D4777 !important;
}

/* =================================
   FOOTER STYLING
   ================================= */

.gallery-footer {
    background-color: #333;
    color: #ccc;
    padding: 20px 0;
    margin-top: 40px;
}

.gallery-footer p {
    margin: 0;
    text-align: center;
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

@media (max-width: 768px) {
    .gallery-title {
        font-size: 2rem;
    }
    
    .gallery-subtitle {
        font-size: 1rem;
    }
    
    .access-info {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .btn, .btn-primary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* =================================
   DEBUG HELPERS (Remove in Production)
   ================================= */

/* Uncomment these for debugging CSS integration issues */
/*
.gallery-main {
    border: 2px dashed red !important;
}

.container {
    border: 1px dashed blue !important;
}
*/