/**
 * Unified Style Sheet for ColecoVision Collection System
 * Matches parent site styling at colecovisionadam.com
 * Version 2.1
 * Updated: 2024-12-27
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #000000;
    color: #FFFFFF;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Styles - Matching parent site */
.site-header {
    background-color: #1a1a1a;
    border-bottom: 3px solid #cc3300;
    padding: 15px 0;
    position: relative;
}

.header-container {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 28px;
    font-weight: bold;
    color: #FFFF00;
    text-decoration: none;
    text-transform: uppercase;
}

.site-title:hover {
    color: #FF0000;
}

/* Navigation Styles */
.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-menu a {
    color: #FFE500;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 3px;
    transition: all 0.3s;
}

.nav-menu a:hover {
    background-color: #cc3300;
    color: #FFFFFF;
}

.nav-menu a.active {
    background-color: #333333;
    color: #FFFFFF;
}

/* Main Container */
.main-container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 20px;
}

/* Content Box - Standard container for content */
.content-box {
    background: linear-gradient(to bottom, #243b55, #1a1a1a);
    border: 2px solid #cc3300;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.content-box:hover {
    border-color: #ff6633;
    box-shadow: 0 12px 35px rgba(255, 102, 51, 0.3);
    transform: translateY(-3px);
}

.content-box h2 {
    color: #FFFF00;
    border-bottom: 2px solid #cc3300;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 24px;
    text-transform: uppercase;
}

.content-box h3 {
    color: #FFFFFF;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Table Styles - Matching parent site tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.data-table thead {
    background-color: #333333;
}

.data-table th {
    padding: 10px;
    text-align: left;
    color: #FFFF00;
    font-weight: bold;
    border-bottom: 2px solid #cc3300;
}

.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #333333;
    color: #FFFFFF;
}

.data-table tbody tr:hover {
    background-color: #222222;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #FFFF00;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    background-color: #000000;
    color: #FFFFFF;
    border: 1px solid #333333;
    border-radius: 3px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #cc3300;
    background-color: #0a0a0a;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #cc3300 0%, #aa2200 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: linear-gradient(135deg, #ff6633 0%, #cc3300 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(204, 51, 0, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #555555 0%, #333333 100%);
    box-shadow: 0 4px 15px rgba(85, 85, 85, 0.4);
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Grid Layouts */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.item-card {
    background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
    border: 2px solid #555;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.item-card:hover {
    border-color: #cc3300;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(204, 51, 0, 0.3);
}

.item-card-title {
    color: #FFFF00;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
    text-transform: uppercase;
}

.item-card-details {
    font-size: 13px;
    color: #CCCCCC;
    line-height: 1.5;
}

.item-card-details strong {
    color: #FFFFFF;
}

/* Category Badges - Fixed with consistent sizing */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin: 2px;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
}

/* Legacy - Red */
.badge-legacy {
    background-color: #FF0000;
    color: #FFFFFF;
}

/* Homebrew - Blue */
.badge-homebrew {
    background-color: #0515C5;
    color: #FFFFFF;
}

/* Non-US - Green */
.badge-non-us {
    background-color: #008000;
    color: #FFFFFF;
}

/* Bootlegs - Purple */
.badge-bootlegs {
    background-color: #800080;
    color: #FFFFFF;
}

/* Test Carts - Orange */
.badge-testcarts {
    background-color: #FF8C00;
    color: #FFFFFF;
}

/* Protos - Gold */
.badge-protos {
    background-color: #FFD700;
    color: #000000;
}

/* Telegames - Indigo */
.badge-telegames {
    background-color: #4B0082;
    color: #FFFFFF;
}

/* Hardware - Blue gradient */
.badge-hardware {
    background: linear-gradient(135deg, #20304a, #2a4a5a);
    color: #87CEEB;
}

/* Prototype - Pink */
.badge-prototype {
    background-color: #FFB6C1;
    color: #4a2030;
}

/* Accessory - Yellow */
.badge-accessory {
    background-color: #F0E68C;
    color: #3a3a20;
}

/* Documentation - Dark gray */
.badge-documentation {
    background-color: #404040;
    color: #FFFFFF;
}

/* Filter Bar */
.filter-bar {
    background: linear-gradient(to bottom, #1c2841, #0f1724);
    border: 2px solid #5a1708;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    color: #FFE500;
    font-size: 12px;
    margin-bottom: 5px;
}

/* Stats Boxes */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-box {
    background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
    border: 1px solid #cc3300;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #FFFF00;
}

.stat-label {
    font-size: 12px;
    color: #CCCCCC;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Alert Messages */
.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid;
}

.alert-success {
    background-color: #1a3a1a;
    border-color: #2a5a2a;
    color: #90EE90;
}

.alert-error {
    background-color: #3a1a1a;
    border-color: #5a2a2a;
    color: #ff6b6b;
}

.alert-info {
    background-color: #1a2a3a;
    border-color: #2a4a5a;
    color: #87CEEB;
}

.alert-warning {
    background-color: #3a3a1a;
    border-color: #5a5a2a;
    color: #FFD700;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    padding: 5px 10px;
    background-color: #1a1a1a;
    border: 1px solid #cc3300;
    color: #FFE500;
    text-decoration: none;
    border-radius: 3px;
}

.pagination a:hover {
    background-color: #cc3300;
    color: #FFFFFF;
    border-color: #ff6633;
}

.pagination .active {
    background-color: #cc3300;
    color: #FFFFFF;
    border-color: #ff6633;
}

/* Modal/Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(to bottom, #243b55, #1a1a1a);
    border: 2px solid #cc3300;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    border-bottom: 2px solid #cc3300;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-title {
    color: #FFFF00;
    font-size: 20px;
    text-transform: uppercase;
}

/* Collection Status Badges */
.collection-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.collection-badge.collected {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #ffffff;
    border: 1px solid #1e7e34;
}

.collection-badge.needed {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: #ffffff;
    border: 1px solid #bd2130;
}

/* Color Bar Divider */
.color-bar {
    width: 100%;
    margin: 20px 0;
    height: 33px;
    background: linear-gradient(to right, #ff0000, #ff8000, #ffff00, #80ff00, #00ff00, #00ff80, #00ffff, #0080ff, #0000ff, #8000ff, #ff00ff, #ff0080);
    border-radius: 4px;
}

/* Manufacturer/Section Headers */
.manufacturer-header {
    background: linear-gradient(135deg, #8B7D3A 0%, #6B5D2A 30%, #8B7D3A 70%, #5B4D1A 100%);
    color: #FFFFFF;
    font-weight: bold;
    text-align: center;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 15px 0;
    margin: 30px 0 5px 0;
    position: relative;
    overflow: hidden;
}

.manufacturer-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    animation: slideGlow 3s ease-in-out infinite;
}

@keyframes slideGlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #333333;
    border-top: 3px solid #cc3300;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .item-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .manufacturer-header {
        font-size: 20px;
    }
    
    
    
    
    /* Add these styles to your style.css file or in a <style> tag in index.php */

/* Mobile and Tablet Responsive Improvements */
@media (max-width: 1024px) {
    /* Header adjustments for tablets/mobile */
    .header-container {
        flex-direction: column;
        padding: 10px;
    }
    
    /* Make banner image responsive */
    .header-container img {
        max-width: 100%;
        height: auto;
        width: auto;
    }
    
    /* Hide the table wrapper and make banner responsive */
    .header-container table {
        width: 100% !important;
        margin: 0 auto;
    }
    
    /* Fix the title positioning */
    .site-title center {
        display: block;
        margin-top: 10px;
        font-size: 20px;
        line-height: 1.2;
    }
    
    /* Make main container full width on mobile */
    .main-container {
        max-width: 100%;
        padding: 10px;
    }
    
    /* Adjust category buttons for mobile */
    .category-nav {
        padding: 10px;
        gap: 5px;
    }
    
    .category-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 auto;
        min-width: 100px;
        text-align: center;
    }
    
    /* Make tables scrollable on mobile */
    .stats-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* Adjust table font sizes */
    .stats-table th,
    .stats-table td {
        font-size: 12px;
        padding: 5px;
    }
    
    /* Stack stats boxes better on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    /* Adjust action buttons */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }
    
    .btn-action {
        width: 100%;
        margin: 0;
    }
    
    /* Adjust content boxes */
    .content-box {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    /* Fix checklist header */
    .checklist-header {
        font-size: 18px;
        padding: 15px 10px;
    }
}

@media (max-width: 768px) {
    /* Even smaller screens */
    .site-title center {
        font-size: 16px;
    }
    
    /* Make nav menu more mobile-friendly */
    .nav-menu {
        width: 100%;
        justify-content: space-around;
        gap: 5px;
        flex-wrap: wrap;
    }
    
    .nav-menu a {
        font-size: 12px;
        padding: 8px 6px;
        flex: 1 1 auto;
        min-width: 70px;
        text-align: center;
    }
    
    /* Category buttons in a better grid on small screens */
    .category-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .category-btn.all {
        grid-column: 1 / -1; /* Full width for "All Categories" button */
    }
    
    /* Make tables more compact */
    .stats-table {
        font-size: 11px;
    }
    
    .publisher-name {
        font-size: 11px !important;
        padding-left: 5px !important;
    }
    
    /* Overall stats adjustments */
    .overall-stats h3 {
        font-size: 14px;
    }
    
    .completion-bar {
        height: 25px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Very small phones */
    .header-container {
        padding: 5px;
    }
    
    /* Hide banner on very small screens if needed */
    .header-container table {
        display: none; /* Optional: hide banner on very small screens */
    }
    
    .site-title center {
        font-size: 14px;
        padding: 10px;
    }
    
    /* Make stats grid single column on very small screens */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Make navigation more compact */
    .nav-menu a {
        font-size: 11px;
        padding: 6px 4px;
        min-width: 60px;
    }
    
    /* Section headers smaller */
    .section-header {
        font-size: 14px;
        padding: 8px;
    }
}

/* iPad specific fixes (portrait and landscape) */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
    /* Better header layout for iPad */
    .header-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .header-container table {
        max-width: 60%;
    }
    
    .site-title {
        flex: 1;
        text-align: center;
        margin: 10px 0;
    }
    
    .site-title center {
        font-size: 22px;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
}

/* Ensure tables don't break on any screen size */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Optional: Add this wrapper div around tables in PHP for better control */
/* Usage: <div class="table-wrapper"><table class="stats-table">...</table></div> */
    
    
    
    
    
    
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #999999; }
.text-danger { color: #ff6b6b; }
.text-success { color: #90EE90; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.hidden { display: none; }
.required { color: #FF0000; }