/* Steel Buckling Website - MASTAN2 Compatible Stylesheet */
/* Designed to harmonize with mastan2.com */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1e1e1e;
    color: #ffffff;
    overflow-x: hidden;
}

/* MASTAN2 Color Variables */
:root {
    --mastan-green: #7CB605;
    --mastan-dark: #2c2c2c;
    --mastan-darker: #1e1e1e;
    --mastan-card: #3a3a3a;
    --mastan-border: #4a4a4a;
    --mastan-text: #ffffff;
    --mastan-text-muted: #cccccc;
}

/* Header Styles - MASTAN2 Inspired */
.header {
    background-image: url('../images/header_bg.png');
    background-repeat: repeat;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    border-bottom: 3px solid var(--mastan-green);
    padding: 0 2rem;
    width: 100%;
    left: 0;
    right: 0;
    margin: 0;
    box-sizing: border-box;
    max-width: 100%;
}

.full-width-header {
    width: 100%;
    left: 0;
    right: 0;
    margin: 0;
    box-sizing: border-box;
    max-width: 100%;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--mastan-text);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header p {
    font-size: 1rem;
    color: var(--mastan-text-muted);
}

/* Navigation - MASTAN2 Style with inline search */
.nav {
    background: var(--mastan-dark);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--mastan-border);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--mastan-darker);
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.nav .search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
    transition: max-width 0.4s ease-in-out;
}

.nav .search-container:focus-within {
    max-width: 650px;
}

.nav .search-input {
    width: 100%;
    padding: 0.6rem 8rem 0.6rem 1.2rem;
    background: var(--mastan-darker);
    border: 1px solid var(--mastan-border);
    border-radius: 20px;
    color: var(--mastan-text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.nav .search-input:focus {
    outline: none;
    border-color: var(--mastan-green);
    box-shadow: 0 0 0 2px rgba(124, 182, 5, 0.2);
    max-width: 600px; /* Expanded width */
}

.nav .search-input::placeholder {
    color: var(--mastan-text-muted);
}

.nav .search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--mastan-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    z-index: 2;
}

.nav .search-clear.visible {
    display: block;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.nav-links a {
    color: var(--mastan-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    text-transform: uppercase;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links a:hover {
    color: var(--mastan-green);
}

/* Filter Panel Styles - MASTAN2 Theme */

/* Filter Search Container Styles */
.filter-search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    justify-content: flex-start;
}

/* Removed filters-row-flex as it's no longer needed */

/* Removed filter-row as it's no longer needed */

/* Filter Search Container Styles */
.filter-search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.search-toggle-btn,
.buckling-toggle-btn {
    background: rgba(60, 60, 60, 0.55);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
    margin-right: 0.2rem;
    padding: 0;
    opacity: 0.7;
}

.search-toggle-btn:hover, .search-toggle-btn:focus,
.buckling-toggle-btn:hover, .buckling-toggle-btn:focus {
    background: rgba(80, 80, 80, 0.85);
    opacity: 1;
    transform: scale(1.08);
}

.search-toggle-btn svg {
    color: #fff;
    stroke: #fff;
    fill: none;
}

.buckling-toggle-btn .arrow-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.filter-search-wrapper {
    position: relative;
    max-width: 400px;
    overflow: visible;
    border-radius: 20px;
    opacity: 1;
    flex: 1;
}

.filter-search-wrapper.expanded {
    max-width: 400px;
    opacity: 1;
}

.filter-search-wrapper.collapsed {
    max-width: 400px;
    opacity: 1;
    pointer-events: auto;
}

.filter-search-input {
    width: 380px;
    padding: 0.6rem 3rem 0.6rem 1.2rem;
    background: var(--mastan-darker);
    border: 1px solid var(--mastan-border);
    border-radius: 20px;
    color: var(--mastan-text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-search-input:focus {
    outline: none;
    border-color: var(--mastan-green);
    box-shadow: 0 0 0 2px rgba(124, 182, 5, 0.2);
}

.filter-search-input::placeholder {
    color: var(--mastan-text-muted);
}

.filter-search-clear {
    position: absolute;
	right: 1.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--mastan-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    z-index: 2;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-search-clear.visible {
    display: flex;
}

.filter-search-clear:hover {
    color: var(--mastan-text);
}

.filter-model-count {
    position: absolute;
    right: 3.0rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--mastan-green);
    color: var(--mastan-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease;
    z-index: 3;
}

.filter-search-wrapper:focus-within .filter-model-count {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.filter-model-count:not(.visible) {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
}

/* Responsive adjustments for filter search */
@media (max-width: 768px) {
    .view-toggle-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }
    
    .filter-search-container {
        justify-content: center;
    }
    
    .view-toggle-buttons {
        justify-content: center;
    }
    
    .filter-search-wrapper.expanded {
        max-width: 320px;
    }
    
    .filter-search-input {
        width: 300px;
    }
    
    .buckling-mode-toggle-bar {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Removed filters-row-flex responsive styles */
}

@media (max-width: 480px) {
    .view-toggle-container {
        gap: 0.6rem;
    }
    
    .filter-search-wrapper.expanded {
        max-width: 280px;
    }
    
    .filter-search-input {
        width: 260px;
        font-size: 0.9rem;
    }
    
    .search-toggle-btn {
        width: 36px;
        height: 36px;
    }
}

/* Ensure filter search doesn't interfere with existing filters */
.filter-row {
    flex: 1;
    min-width: 0;
}

.filter-buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: var(--mastan-text);
    font-size: 1rem;
    white-space: nowrap;
}

.filter-buttons .filter-btn {
    background: var(--mastan-darker, #222);
    color: #fff;
    font-weight: 500;
    border: 1.5px solid #555;
    border-radius: 8px;
    padding: 0.22rem 0.7rem;
    font-size: 0.87rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border 0.15s;
    min-width: 80px;
    min-height: 28px;
    text-transform: capitalize;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.filter-buttons .filter-btn.active,
.filter-buttons .filter-btn:focus {
    background: var(--mastan-green);
    color: #fff;
    font-weight: 700;
    outline: none;
    border: none;
}

.filter-buttons .filter-btn:hover:not(.active) {
    background: #333;
    color: #fff;
    border-color: #888;
}

.filter-buttons .filter-btn:first-child {
    margin-left: 0.5rem;
}

/* View toggle buttons */
.view-toggle-container {
    max-width: 1200px;
    margin: 0 auto 0.5rem auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.view-toggle-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-toggle-btn {
    background: var(--mastan-darker);
    border: 2px solid var(--mastan-border);
    color: var(--mastan-text);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    min-width: 44px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border 0.15s;
}

.view-toggle-btn.active,
.view-toggle-btn:focus {
    background: var(--mastan-green);
    color: var(--mastan-darker);
    border-color: var(--mastan-green);
    outline: none;
}

.view-toggle-btn:hover {
    background: #9acd32;
    color: var(--mastan-darker);
    border-color: #9acd32;
}

@media (max-width: 1200px) {
    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .filters-row-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    /* Removed filter-row responsive styles */
    .filter-buttons {
        justify-content: center;
    }
    .view-toggle-container {
        justify-content: center;
    }
}

/* Main Content */
.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 2rem;
    background: var(--mastan-darker);
    transition: max-width 0.5s cubic-bezier(0.4, 0.2, 0.2, 1); /* Smooth width transition */
}

/* Content Sections */
.content-section {
    margin-top: 3rem;
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    padding: 1.5rem 2rem;
}

.content-section h2 {
    margin-bottom: 0;
    text-align: left;
    font-size: 1.5rem;
}

.content-section h2.collapsible-title {
    justify-content: space-between;
    padding-bottom: 1.5rem;
}

.content-section h2.collapsible-title:hover {
    color: var(--mastan-green);
}

.collapsible-title .toggle-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 9px solid currentColor;
    transition: transform 0.3s ease;
}

.collapsible-title .toggle-arrow.up {
    transform: rotate(180deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding-top 0.4s ease-out, padding-bottom 0.4s ease-out;
    max-height: 1000px;
}

.collapsible-content.collapsed {
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0;
}

.content-wrapper {
    max-width: none;
    padding-top: 1.5rem;
    border-top: 1px solid #4a4a4a;
    color: var(--mastan-text-muted);
    line-height: 1.7;
}

.content-wrapper p {
    margin-bottom: 1.5rem;
}

.content-wrapper h3 {
    color: var(--mastan-green);
    margin: 2rem 0 1rem 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.content-wrapper ul, .content-wrapper ol {
    margin-left: 2rem;
    margin-bottom: 2rem;
}

.content-wrapper li {
    margin-bottom: 0.5rem;
}

.tip-box {
    background: rgba(52,152,219,0.1);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
    border-left: 4px solid #3498db;
}

.tip-box h4 {
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Gallery Styles - Responsive Grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    position: relative;
    margin-top: 0.5rem;
    align-items: stretch; /* ensure grid items in a row are equal height */
}

/* For tablets */
@media (max-width: 992px), (orientation: portrait) and (max-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* For mobile devices */
@media (max-width: 768px), (orientation: portrait) and (max-width: 900px) {
    .gallery {
        grid-template-columns: 1fr;
    }
}

/* Model Card Styling to match image */
.model-card {
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    overflow: hidden;
    cursor: default;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 350px; /* Reduced from 400px */
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.card-header {
    background-color: var(--card-header-color);
    padding: 1.5rem 1rem; /* Reduced from 2rem to 1.5rem */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 80px; /* Fixed height instead of min-height for consistency */
    box-sizing: border-box;
}

.card-header h3 {
    color: white;
    margin: 0;
    font-size: 1.4rem; /* Slightly reduced from 1.5rem */
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    line-height: 1.6; /* Increased from 1.4 for larger line spacing */
    text-align: center; /* Ensure text is centered */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.card-body {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem; /* Reduced from 1.5rem */
    min-height: 80px; /* Reduced from 100px */
}

.card-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-body p {
    color: #ccc;
    font-size: 0.9rem; /* Slightly reduced from 0.95rem */
    line-height: 1.5; /* Reduced from 1.6 */
    margin-bottom: 0.75rem;
    height: calc(1.5 * 3 * 0.9rem); /* Adjusted for new line-height and font-size */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-tags {
    display: flex;
    flex-wrap: wrap; /* allow tags to wrap to the next line */
    gap: 0.5rem 0.75rem; /* row and column gap between tags */
    overflow: visible;
    white-space: normal; /* allow wrapping */
    margin-bottom: 1rem;
    min-height: 24px;
}

.tag {
    margin-right: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Cycle through a few colors for the tags */
.tag:nth-child(5n+1) { color: #3498db; }
.tag:nth-child(5n+2) { color: #e67e22; }
.tag:nth-child(5n+3) { color: #9b59b6; }
.tag:nth-child(5n+4) { color: #f1c40f; }
.tag:nth-child(5n+5) { color: #1abc9c; }

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #aaa;
    border-top: 1px solid #444;
    padding-top: 1rem;
}

.no-results, .error-message {
    text-align: center;
    padding: 3rem;
    color: var(--mastan-text-muted);
    grid-column: 1 / -1;
}

.no-results h3, .error-message h3 {
    color: var(--mastan-green);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.error-message {
    color: #ff6b6b;
}

.error-message h3 {
    color: #ff6b6b;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--mastan-text-muted);
    grid-column: 1 / -1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--mastan-border);
    border-top: 4px solid var(--mastan-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Loading spinner for buttons */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.show-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: var(--mastan-card);
    color: var(--mastan-text-muted);
}

.show-more-btn:disabled:hover {
    background: var(--mastan-card);
    color: var(--mastan-text-muted);
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Lazy loading styles */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy.loaded {
    opacity: 1;
}

/* Lazy loading placeholder */
.lazy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    z-index: -1;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 2rem;
    }
    
    .nav .search-container {
        max-width: 100%;
        margin: 0;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .main {
        padding: 2rem 1rem;
    }
    
    .filters-content {
        padding: 0 1rem;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .filter-label {
        min-width: auto;
    }
    
    /* Responsive thumbnail adjustments */
    .card-thumbnail {
        height: 200px; /* Standardized height to match all views */
    }
    
    .card-thumbnail-container {
        height: 200px; /* Standardized height to match all views */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .model-card {
        min-height: 300px; /* Reduced from 350px for more compact mobile view */
    }
    
    .card-header {
        height: 70px; /* Fixed height instead of min-height for consistency */
        padding: 1rem 0.75rem; /* Reduced padding */
        box-sizing: border-box;
    }
    
    .card-body {
        padding: 0.75rem; /* Reduced padding */
        min-height: 60px; /* Reduced minimum height */
    }
    
    .card-body p {
        font-size: 0.85rem; /* Smaller font on mobile */
        line-height: 1.4; /* Tighter line spacing */
    }
    
    /* Responsive live gallery adjustments for mobile */
    .live-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .live-image-card {
        width: 100%;
        height: auto;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .live-image-thumbnail {
        width: 100%;
        height: auto;
        max-height: 300px;
    }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .live-gallery {
        grid-template-columns: repeat(auto-fit, 400px);
        gap: 1.5rem;
        justify-content: center;
    }
    
    .live-image-card {
        width: 400px;
        height: 400px;
    }
    
    .live-image-thumbnail {
        width: 400px;
        height: 400px;
    }
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

footer {
    background: var(--mastan-dark);
    color: var(--mastan-text-muted);
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--mastan-border);
}

footer strong {
    color: var(--mastan-green);
}

.footer {
    background: var(--mastan-dark);
    color: var(--mastan-text-muted);
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--mastan-border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.footer-content p:first-child {
    font-weight: 600;
    color: var(--mastan-text);
}

.model-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ccc;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    height: calc(1.5 * 3 * 0.9rem); /* line-height * lines * font-size */
}

.model-card .card-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #4f4f4f;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #b0b0b0;
}

.model-card .meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background-color: transparent;
    padding: 0;
    border-radius: 4px;
}

.model-card .meta-item strong {
    font-weight: 600;
    color: #ddd;
}

/* Card Hover Effect */
.model-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.model-card:hover .card-overlay {
    opacity: 1;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    width: 100%;
}

.show-more-btn {
    background-color: #7CB605;
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.show-more-btn:hover {
    background-color: #6b9f04;
    transform: translateY(-2px);
}

.show-more-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Add thumbnail styling */
.card-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover; /* This ensures automatic scaling while maintaining aspect ratio */
    border-radius: 8px 8px 0 0;
    background-color: #2a2a2a;
    display: block;
    transition: transform 0.3s ease; /* Smooth scaling transition */
}

.card-thumbnail-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background-color: #2a2a2a; /* Fallback background */
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Add a subtle overlay on thumbnail hover */
.card-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.model-card:hover .card-thumbnail-overlay {
    opacity: 1;
}

/* Ensure thumbnails scale properly on hover */
.model-card:hover .card-thumbnail {
    transform: scale(1.05); /* Slight zoom effect on hover */
}

.model-count {
    position: absolute;
    right: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #f0c43a;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.search-container:focus-within .model-count {
    opacity: 1;
}

/* Move to Top Button */
.move-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--mastan-green, #7CB605);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.4s ease;
}

.move-to-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

.move-to-top-btn .arrow-up {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid currentColor;
    display: block;
    transition: transform 0.3s ease;
}

.move-to-top-btn:hover .arrow-up {
    transform: translateY(-2px);
}

.contact-info {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: rgba(0,0,0,0.2);
    border-radius: 6px;
    border-left: 3px solid var(--mastan-green);
}

.contact-info a {
    color: var(--mastan-green);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info a:hover {
    color: #fff;
}

/* Add/restore search bar styles for filters section */
.filters .search-container {
    display: flex;
    align-items: center;
    position: relative;
    max-width: 700px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 60px; /* Adjust based on search input height */
    opacity: 1;
}

.filters .search-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0.6rem 8rem 0.6rem 1.2rem;
    background: var(--mastan-darker);
    border: 1px solid var(--mastan-border);
    border-radius: 20px;
    color: var(--mastan-text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    max-width: none;
}

.filters .model-count {
    position: absolute;
    right: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #f0c43a;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.filters .search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--mastan-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    z-index: 2;
}

.filters .search-container:focus-within {
    max-width: 1200px;
}

.filters .search-input:focus {
    outline: none;
    border-color: var(--mastan-green);
    box-shadow: 0 0 0 2px rgba(124, 182, 5, 0.2);
    max-width: 1200px;
}

.filters .search-input::placeholder {
    color: var(--mastan-text-muted);
}

.filters .search-container.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

/* View toggle buttons */
.view-toggle-container {
    max-width: 1200px;
    margin: 0 auto 1rem auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.view-toggle-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-toggle-btn {
    background: #333;
    border: 1px solid #555;
    color: #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
    box-sizing: border-box;
    height: auto;
    min-height: unset;
    min-width: unset;
}

.view-toggle-btn svg {
    vertical-align: middle;
    display: block;
    margin: 0 auto;
    width: 1.2em;
    height: 1.2em;
}

.view-toggle-btn.active, .view-toggle-btn:hover {
    background: var(--mastan-green);
    color: #fff;
    border-color: var(--mastan-green);
}

/* List view styles for gallery */
.gallery.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
}

.gallery.list-view .model-card {
    flex-direction: row;
    min-height: 180px;
    max-width: 100%;
    width: 100%;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 16px;
    margin: 0;
}

.gallery.list-view .card-thumbnail-container {
    flex: 0 0 400px;
    max-width: 400px;
    min-width: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    border-radius: 0; /* Sharp corners for list view */
}

.gallery.list-view .card-thumbnail {
    width: 400px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    max-width: 400px;
    max-height: 200px;
}

.gallery.list-view .card-header {
    display: none; /* Hide card-header in list view */
}

/* Hide list-view-title in card view */
.list-view-title {
    display: none;
}

/* Show list-view-title only in list view */
.gallery.list-view .list-view-title {
    display: inline-block;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mastan-text);
    background-color: var(--list-view-title-bg-color, #444);
    padding: 0.1rem 0.5rem;
    border-radius: 8px;
    text-align: left;
    width: auto !important;
    max-width: none !important;
    align-self: flex-start;
}

.gallery.list-view .card-body {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: 24px; /* Reduced spacing between card-body and list-view-buttons */
    padding: 0;
    align-self: center;
}

.gallery.list-view .card-tags {
    margin-bottom: 0.5rem;
}

.gallery.list-view .list-view-buttons {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    margin-left: 0;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
}

.gallery.list-view .list-view-buttons button {
    margin-bottom: 0;
    width: 220px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-align: center;
    font-size: 1.08rem;
    font-weight: 600;
    border-radius: 5px;
    background-color: var(--mastan-green, #7CB605);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
}

.gallery.list-view .list-view-buttons button:hover {
    background-color: #6b9f04;
    color: #fff;
}

@media (max-width: 900px) {
    .gallery.list-view .model-card {
        flex-direction: column;
        align-items: stretch;
    }
    .gallery.list-view .card-thumbnail-container {
        margin-right: 0;
        margin-bottom: 1rem;
        max-width: 100%;
        min-width: auto;
        flex: none;
    }
    .gallery.list-view .card-thumbnail {
        width: 100%;
        height: 180px;
        max-width: 100%;
        max-height: 180px;
    }
}

/* List view action buttons for model cards */
.list-view-buttons {
    display: none; /* default, shown only in list view via JS */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-left: auto;
}

.gallery.list-view .list-view-buttons {
    display: flex;
}

.list-view-buttons button {
    background-color: var(--mastan-green, #7CB605);
    color: #fff;
    border: none;
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    width: 220px; /* Fixed width for all buttons */
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-align: center;
    margin-bottom: 0.5rem; /* Add spacing between all buttons */
}

.list-view-buttons button:last-child {
    margin-bottom: 0; /* Remove margin from last button */
}

.list-view-buttons button:hover {
    background-color: #6b9f04;
    color: #fff;
}

/* Make main container wider in list view */
.gallery.list-view ~ .main,
.main:has(.gallery.list-view) {
    max-width: 1500px;
}

.main, .gallery {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding-left: 0;
    padding-right: 0;
}

.card-view-buttons-row {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

/* Card view: make cards equal height and pin buttons to bottom for alignment */
.gallery:not(.list-view) .model-card {
    height: 100%;
}
.gallery:not(.list-view) .card-body {
    display: flex;
    flex-direction: column;
}
.gallery:not(.list-view) .card-view-buttons-row {
    margin-top: auto; /* push buttons to bottom of card body */
}

/* Card view: ensure tag area reserves space for two rows */
.gallery:not(.list-view) .card-tags {
	min-height: 56px;
	margin-bottom: 1.25rem;
}

.card-view-buttons-row button {
    background: var(--mastan-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    white-space: nowrap;
}

.card-view-buttons-row button:hover {
    background: #6a9a04;
    transform: translateY(-2px) scale(1.04);
}

/* Hide card-view-buttons-row in list view (handled by JS, but for safety) */
.gallery.list-view .card-view-buttons-row {
    display: none !important;
}

.gallery:not(.list-view) .model-card:hover .card-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
}

.buckling-mode-toggle-bar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 auto;
    justify-content: flex-start;
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
    padding-left: 0;
    padding-right: 0;
}

.buckling-toggle-btn {
    background: rgba(60, 60, 60, 0.55);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
    margin-right: 0.2rem;
    padding: 0;
    opacity: 0.7;
}

.buckling-toggle-btn:hover, .buckling-toggle-btn:focus {
    background: rgba(80, 80, 80, 0.85);
    opacity: 1;
    transform: scale(1.08);
}

.buckling-toggle-btn .arrow-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.chevron-arrow {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-right: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: rotate(-45deg);
    transition: transform 0.3s;
    margin-top: 2px;
}

.buckling-toggle-btn.active .chevron-arrow {
    transform: rotate(135deg);
}

.buckling-mode-filter-wrapper {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
    opacity: 1;
    will-change: max-height, opacity;
}

.buckling-mode-filter-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.buckling-mode-filter-wrapper.expanded {
    max-height: 200px;
    opacity: 1;
    pointer-events: auto;
    margin: 1.2rem 0 1.5rem 0;
    width: 100%;
}

.buckling-toggle-btn .arrow-icon {
    display: none;
}
.buckling-toggle-btn .arrow-down {
    display: inline-block;
}
.buckling-toggle-btn.active .arrow-down {
    display: none;
}
.buckling-toggle-btn.active .arrow-up {
    display: inline-block;
}
.buckling-toggle-btn .arrow-up {
    display: none;
}

/* Card thumbnail and layout for card/list view */
.card-content-flex {
  display: block;
}
.gallery.list-view .card-content-flex {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}
.card-thumbnail-container {
  width: 100%;
  height: auto;
  aspect-ratio: 377 / 180;
  margin: 0 auto 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery:not(.list-view) .card-thumbnail-container {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  aspect-ratio: 377 / 180;
  margin: 0 auto 1rem auto;
  justify-content: center;
}
.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #222;
}
.gallery:not(.list-view) .card-thumbnail {
  width: 100%;
  height: 100%;
  aspect-ratio: 377 / 180;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}
.card-main-content {
  flex: 1 1 0%;
}

/* Live Gallery Styles */
.live-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, 462.66px);
    gap: 1.5rem;
    position: relative;
    margin-top: 0.5rem;
    justify-content: center;
}

.live-gallery.collapsed,
#live-pagination-container.collapsed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.4s, opacity 0.3s;
}

.live-image-card {
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 463.83px;
    width: 462.66px;
    min-height: 0;
}
.live-image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}
.live-image-thumbnail {
    width: 462.66px;
    height: 463.83px;
    object-fit: cover;
    border-radius: 0;
    background-color: #2a2a2a;
    display: block;
    flex: 1 1 auto;
    transition: transform 0.3s ease;
}
.live-image-card:hover .live-image-thumbnail {
    transform: scale(1.05);
}
.live-image-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: #222;
    padding: 0.5rem 1rem;
    text-align: center;
    border-radius: 0 0 8px 8px;
    margin: 0;
}

.live-image-overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.6rem 1rem 0.6rem 1rem;
    border-radius: 0 0 8px 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    text-align: center;
    box-sizing: border-box;
}
.live-image-card:hover .live-image-overlay {
    opacity: 1;
}

.live-image {
    cursor: pointer;
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.image-modal-content {
    margin: auto;
    display: block;
    width: 90vw;
    max-width: 700px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 32px rgba(0,0,0,0.25);
    border-radius: 8px;
    background: #fff;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.image-modal-close:hover,

/* How to Print Section Styles */
.print-instructions {
    margin-bottom: 2rem;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--mastan-card);
    border-radius: 8px;
    border-left: 4px solid var(--mastan-green);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.instruction-step:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(124, 182, 5, 0.2);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--mastan-green);
    color: var(--mastan-dark);
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    line-height: 1.6;
}

.step-content strong {
    color: var(--mastan-green);
    font-weight: 600;
}

.print-tips {
    background: rgba(124, 182, 5, 0.1);
    border: 1px solid rgba(124, 182, 5, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.print-tips h4 {
    color: var(--mastan-green);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.print-tips ul {
    list-style: none;
    padding: 0;
}

.print-tips li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.print-tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--mastan-green);
    font-weight: bold;
    font-size: 1.1rem;
}

.print-tips li:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .instruction-step {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .print-tips {
        padding: 1rem;
    }
}
.image-modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/*
 * Device switch link styling
 *
 * The links at the bottom of each page for switching between
 * Desktop, Mobile and Tablet views should match the green accent
 * used elsewhere on the site. Without explicit styling these
 * anchors use the browser default link colour. Applying the
 * green colour here keeps the footer consistent with the rest
 * of the UI.
 */
.device-switch a {
    color: var(--mastan-green);
    text-decoration: underline;
}

.device-switch a:hover {
    color: var(--mastan-green);
}

