/*
Theme Name: The Gaming Boardroom
Theme URI: https://thegamingboardroom.com
Description: Custom membership theme for The Gaming Boardroom with three-tier access control (Free, Pro, Elite)
Version: 1.0.0
Author: Your Name
Author URI: https://yoursite.com
Text Domain: tgb
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

This theme integrates with tgb-access.php for membership functionality.
*/

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
}

/* ==========================================================================
   LAYOUT & CONTAINERS
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-content {
    min-height: calc(100vh - 200px);
}

.main-content {
    padding: 40px 0;
}

/* ==========================================================================
   HEADER STYLES
   ========================================================================== */

.site-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding .custom-logo img {
    max-height: 50px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
}

.site-title a {
    text-decoration: none;
    color: #333;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    padding: 0.5rem 1rem;
}

.main-navigation a:hover {
    color: #007cba;
}

/* ==========================================================================
   ACCESS CONTROL STYLES (Your existing system)
   ========================================================================== */

.tgb-gated-content-message {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.tgb-access-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 5px;
}

.tgb-free-access { 
    background: #28a745; 
    color: white; 
}

.tgb-pro-access { 
    background: #ffc107; 
    color: black; 
}

.tgb-elite-access { 
    background: #dc3545; 
    color: white; 
}

.tgb-padlock-icon {
    color: #dc3545;
    margin-right: 5px;
    font-size: 14px;
}

/* ==========================================================================
   POST GRID & CARDS
   ========================================================================== */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

.post-title a {
    text-decoration: none;
    color: #333;
}

.post-title a:hover {
    color: #007cba;
}

.post-excerpt {
    color: #666;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #999;
}

.post-type-badge {
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.button, 
.tgb-button {
    display: inline-block;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.button:hover, 
.tgb-button:hover {
    background: #005a87;
    color: white;
}

.button-alt {
    background: #666;
}

.button-alt:hover {
    background: #444;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    text-decoration: none;
    color: #007cba;
}

.pagination a:hover {
    background: #f8f9fa;
}

.pagination .current {
    background: #007cba;
    color: white;
}

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

.site-footer {
    background: #333;
    color: #fff;
    padding: 2rem 0


/* ==========================================================================
   TGB CONSOLIDATED JAVASCRIPT STYLES
   ========================================================================== */

/* Shared interaction states */
.tgb-active {
    background-color: #8B004B !important;
    color: #ffffff !important;
}

.tgb-loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

.tgb-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #8B004B;
    border-radius: 50%;
    animation: tgb-spin 1s linear infinite;
    margin-left: 5px;
}

.tgb-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.tgb-visible {
    display: block !important;
}

.tgb-hidden {
    display: none !important;
}

/* Buttons and Pills (unified styling) */
.tgb-button,
.tgb-pill {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background-color: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-decoration: none;
    user-select: none;
}

.tgb-button:hover,
.tgb-pill:hover:not(.tgb-active) {
    background-color: #d9d9d9;
    transform: translateY(-1px);
}

/* Engagement buttons */
.tgb-like-button,
.tgb-favourite-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #666;
}

.tgb-like-button:hover,
.tgb-favourite-button:hover {
    border-color: #8B004B;
    color: #8B004B;
    text-decoration: none;
}

.tgb-like-button.tgb-liked,
.tgb-favourite-button.tgb-favourited {
    background-color: #8B004B;
    color: white;
    border-color: #8B004B;
}

.tgb-counter,
.like-count {
    font-weight: bold;
    font-size: 12px;
}

/* Enhanced Search Interface */
.tgb-ajax-search {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

#tgb-search-keyword {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

#tgb-search-keyword:focus {
    outline: none;
    border-color: #8B004B;
    box-shadow: 0 0 0 2px rgba(139, 0, 75, 0.2);
}

.tgb-filters {
    margin-bottom: 15px;
}

.tgb-filter-group {
    margin-bottom: 15px;
}

.tgb-filter-group strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.tgb-filter-actions {
    margin-bottom: 20px;
    text-align: center;
}

#tgb-search-results-wrapper {
    position: relative;
    min-height: 100px;
}

.tgb-search-results {
    min-height: 50px;
}

#tgb-search-loading {
    text-align: center;
    padding: 20px;
    display: none;
}

#tgb-load-more-wrapper {
    text-align: center;
    margin-top: 20px;
    display: none;
}

.tgb-search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tgb-card {
    background: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 3px solid #8B004B;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tgb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tgb-card a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.tgb-card a:hover {
    color: #8B004B;
}

.tgb-result-meta {
    margin-top: 10px;
}

.tgb-meta-pill {
    display: inline-block;
    padding: 3px 8px;
    background: #e9ecef;
    color: #495057;
    border-radius: 12px;
    font-size: 11px;
    margin: 2px 4px 2px 0;
    text-transform: uppercase;
    font-weight: bold;
}

.tgb-meta-pill.tag {
    background: #ffc107;
    color: #212529;
}

.tgb-meta-pill.category {
    background: #28a745;
    color: white;
}

/* Carousel enhancements */
.tgb-carousel-block {
    margin: 30px 0;
}

.tgb-carousel-block h2 {
    margin-bottom: 20px;
    color: #333;
}

.carousel-wrapper {
    position: relative;
}

.carousel-item {
    position: relative;
    margin: 0 5px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.carousel-item:hover {
    transform: translateY(-3px);
}

.carousel-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.carousel-bg img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px 15px 15px;
}

.carousel-overlay h6 {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px;
    border-radius: 50%;
    font-size: 20px;
    z-index: 10;
}

/* Custom carousel arrows */
.tgb-carousel-arrow,
.slick-prev.tgb-carousel-arrow,
.slick-next.tgb-carousel-arrow {
    background: #8B004B !important;
    color: white !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 100;
}

.tgb-carousel-arrow:hover,
.slick-prev.tgb-carousel-arrow:hover,
.slick-next.tgb-carousel-arrow:hover {
    background: #6d0039 !important;
    transform: scale(1.1) !important;
}

.tgb-carousel-arrow:before {
    color: white !important;
    font-size: 16px !important;
}

/* Loading spinner */
.tgb-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8B004B;
    border-radius: 50%;
    animation: tgb-spin 1s linear infinite;
}

@keyframes tgb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error and no results states */
.tgb-no-results,
.tgb-error {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    border-radius: 4px;
}

.tgb-error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Debug styles */
.tgb-debug {
    position: fixed;
    top: 32px;
    right: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    z-index: 9999;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Responsive design */
@media (max-width: 768px) {
    .tgb-filter-group {
        margin-bottom: 15px;
    }
    
    .tgb-pill {
        margin: 2px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .carousel-overlay h6 {
        font-size: 12px;
    }
    
    .tgb-card {
        padding: 12px;
    }
    
    .tgb-debug {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
    }
}
