/* ================================================================
   PLANT DETAIL PAGE - CSS
   Version: 5.0
   Path: public/css/plant-detail.css
   ================================================================ */

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: rgba(16, 185, 129, 0.15);
    
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --card-bg: #1e293b;
    --card-hover: #334155;
    
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --border: #334155;
    --border-light: #475569;
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    
    --radius: 12px;
    --image-width: 70%;
    --content-width: 30%;
    
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 64px;
    
    --safe: #4ade80;
    --caution: #fbbf24;
    --danger: #f87171;
}

/* ============================================================
   SPLIT LAYOUT
   ============================================================ */
.split-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   IMAGE PANEL
   ============================================================ */
.image-panel {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--image-width);
    height: 100vh;
    background: var(--bg);
    z-index: 10;
    overflow: hidden;
}

.image-blur-bg {
    position: absolute;
    inset: -100px;
    background-size: cover;
    background-position: center;
    filter: blur(60px) saturate(1.2) brightness(0.4);
    transform: scale(1.3);
    transition: background-image 0.5s ease;
    z-index: 1;
}

.image-blur-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(15,23,42,0.8) 100%);
    z-index: 2;
}

.image-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    padding: var(--space-lg);
    transition: padding 0.3s ease;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: zoom-in;
}

.main-image:hover {
    transform: scale(1.01);
}

/* Image Modes */
.image-container.mode-smart {
    padding: 0;
}

.image-container.mode-smart .main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-container.mode-fill {
    padding: 0;
}

.image-container.mode-fill .main-image {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
}

.image-gradient {
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--bg-secondary));
    z-index: 4;
    pointer-events: none;
}

/* ============================================================
   IMAGE CONTROLS - Fade on hover
   ============================================================ */
.image-controls-wrapper {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.image-controls-wrapper > * {
    pointer-events: auto;
}

.back-btn,
.image-bottom-bar {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-panel:hover .back-btn,
.image-panel:hover .image-bottom-bar {
    opacity: 1;
}

/* Back Button */
.back-btn {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

/* Bottom Bar */
.image-bottom-bar {
    position: absolute;
    bottom: var(--space-md);
    left: var(--space-md);
    right: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.image-nav {
    display: flex;
    gap: var(--space-xs);
}

.nav-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

/* Center Controls */
.image-center-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 100px;
    border: 1px solid var(--border);
}

.mode-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 100px;
    transition: all 0.2s ease;
}

.mode-btn:hover { color: var(--text-muted); }

.mode-btn.active {
    background: var(--primary);
    color: var(--bg);
}

.control-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

.image-counter {
    padding: 0 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
}

/* ============================================================
   CONTENT PANEL
   ============================================================ */
.content-panel {
    margin-left: var(--image-width);
    width: var(--content-width);
    min-height: 100vh;
    background: var(--bg-secondary);
    position: relative;
    z-index: 20;
}

.content-inner {
    padding: var(--space-lg) var(--space-md);
    padding-bottom: 100px;
}

/* Hero Section */
.hero-section {
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-md);
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-category {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary);
}

.badge-native {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: #fbbf24;
}

.badge-featured {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: #a855f7;
}

.hero-code {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.hero-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.hero-extra {
    font-size: 13px;
    color: var(--text-dim);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-hover);
    border-radius: 10px;
    font-size: 18px;
}

.stat-icon.safe {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid var(--safe);
}

.stat-icon.caution {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid var(--caution);
}

.stat-icon.danger {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid var(--danger);
}

.stat-text {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
}

/* ============================================================
   COMPACT INFO SECTION
   ============================================================ */
.info-compact {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.info-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-bottom: 1px solid var(--border);
}

.info-cell {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-cell:nth-child(odd) {
    border-right: 1px solid var(--border);
}

.info-cell:nth-last-child(-n+2) {
    border-bottom: none;
}

.cell-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cell-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

/* Visual Row */
.info-row-visual {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(16, 185, 129, 0.03);
}

.visual-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--card-hover);
    border-radius: 6px;
    font-size: 12px;
}

.visual-icon { font-size: 14px; }
.visual-text { color: var(--text-muted); font-weight: 500; }

/* Tolerance */
.tolerance-compact {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.tolerance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tol-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tol-label {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 55px;
}

.tol-bar {
    flex: 1;
    height: 5px;
    background: var(--card-hover);
    border-radius: 3px;
    overflow: hidden;
}

.tol-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #34d399);
    border-radius: 3px;
}

/* Tags Section */
.tags-section {
    padding: 12px;
}

.tags-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.tags-row:last-child { margin-bottom: 0; }

.tags-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    min-width: 70px;
    padding-top: 4px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--card-hover);
    color: var(--text-muted);
}

/* ============================================================
   DESCRIPTION
   ============================================================ */
.description-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.description-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.btn-edit-desc {
    padding: 6px 12px;
    background: var(--card-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-desc:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

.description-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-muted);
}

.description-text p { margin-bottom: var(--space-sm); }
.description-text p:last-child { margin-bottom: 0; }
.description-text strong { color: var(--text); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.projects-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.projects-count {
    padding: 2px 8px;
    background: var(--primary);
    color: var(--bg);
    font-size: 11px;
    font-weight: 700;
    border-radius: 100px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.projects-empty {
    text-align: center;
    padding: var(--space-md);
    color: var(--text-dim);
    font-size: 13px;
}

.project-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--card-hover);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: var(--border-light);
    transform: translateX(4px);
}

.project-image {
    width: 56px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg);
}

.project-info { flex: 1; }

.project-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.project-meta {
    font-size: 11px;
    color: var(--text-dim);
}

.project-arrow {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 12px;
    transition: all 0.2s;
}

.project-card:hover .project-arrow {
    background: var(--primary);
    color: var(--bg);
}

/* ============================================================
   RELATED
   ============================================================ */
.related-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: var(--space-md);
}

.related-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
}

.related-card {
    background: var(--card-hover);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.related-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
}

.related-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg);
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: var(--space-sm);
}

.related-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.related-sci {
    font-size: 10px;
    font-style: italic;
    color: var(--text-dim);
}

/* ============================================================
   STICKY ACTION BAR
   ============================================================ */
.sticky-action-bar {
    position: fixed;
    bottom: var(--space-sm);
    left: calc(var(--image-width) + var(--space-sm));
    right: var(--space-sm);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow: var(--shadow-lg);
}

.action-bar-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.action-bar-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.action-bar-text {
    display: flex;
    flex-direction: column;
}

.action-bar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.action-bar-code {
    font-size: 10px;
    color: var(--text-dim);
}

.action-bar-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

.action-bar-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-left: auto;
}

.action-bar-name-mobile {
    display: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--card-hover);
    color: var(--text);
    border-radius: 50%;
}

.btn-icon:hover { background: var(--card-bg); }

.btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   ADD TO PROJECT MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    backdrop-filter: blur(8px);
}

.modal-overlay.show { display: flex; }

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    max-width: 440px;
    width: 100%;
    max-height: 95vh;
    overflow: hidden;
    border: 1px solid var(--border);
    animation: modalIn 0.25s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-hover);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--primary);
    color: var(--bg);
}

.modal-body {
    padding: var(--space-md);
    overflow-y: auto;
    flex: 1;
}

.form-group {
    margin-bottom: var(--space-sm);
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
}

.form-input, .form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.form-input-group {
    display: flex;
    gap: 8px;
}

.form-input-group .form-input {
    flex: 1;
}

.btn-auto {
    padding: 12px 14px;
    background: var(--card-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-auto:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.modal-footer {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-footer .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 13px;
}

.btn-secondary {
    background: var(--card-hover);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.lightbox.show { display: flex; }

.lightbox-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
}

.lightbox-main {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--space-lg);
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}

.lightbox:hover .lightbox-nav {
    opacity: 1;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev { left: var(--space-md); }
.lightbox-nav.next { right: var(--space-md); }

.lightbox-counter {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
}

.lightbox:hover .lightbox-counter {
    opacity: 1;
}

.lightbox-thumbs {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.3s ease;
}

.lightbox:hover .lightbox-thumbs {
    opacity: 1;
}

.lightbox-thumbs.hidden {
    display: none;
}

.lightbox-thumb {
    width: 60px;
    height: 45px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.lightbox-thumb:hover {
    opacity: 0.8;
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: var(--primary);
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   LOADING & ERROR STATES
   ============================================================ */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: var(--space-md);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-muted);
    font-size: 14px;
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: var(--space-md);
    text-align: center;
    padding: var(--space-md);
}

.error-icon {
    font-size: 48px;
}

.error-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.error-message {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    padding: 12px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 400;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1400px) {
    :root {
        --image-width: 65%;
        --content-width: 35%;
    }
}

@media (max-width: 1200px) {
    :root {
        --image-width: 60%;
        --content-width: 40%;
    }
}

@media (max-width: 1024px) {
    :root {
        --image-width: 55%;
        --content-width: 45%;
    }
    
    .action-bar-code { display: none; }
}

@media (max-width: 900px) {
    .split-container { flex-direction: column; }
    
    .image-panel {
        position: relative;
        width: 100%;
        height: 50vh;
    }
    
    .content-panel {
        margin-left: 0;
        width: 100%;
    }
    
    .image-gradient { display: none; }
    
    .sticky-action-bar {
        left: var(--space-xs);
        right: var(--space-xs);
        justify-content: center;
    }
    
    .action-bar-info { display: none; }
    .action-bar-divider { display: none; }
}

@media (max-width: 768px) {
    .back-btn { display: none; }
    .image-bottom-bar { opacity: 1; }
    .image-nav { display: none; }
    
    .hero-title { font-size: 26px; }
    .hero-subtitle { font-size: 17px; }
    .hero-extra { font-size: 14px; }
    .hero-code { font-size: 13px; }
    .badge { font-size: 12px; }
    
    .stat-value { font-size: 14px; }
    .stat-label { font-size: 12px; }
    
    .cell-label { font-size: 11px; }
    .cell-value { font-size: 14px; }
    
    .visual-item { font-size: 13px; }
    .tol-label { font-size: 12px; }
    .tags-label { font-size: 12px; }
    .tag { font-size: 12px; }
    
    .description-title { font-size: 15px; }
    .description-text { font-size: 15px; }
    
    .projects-title { font-size: 15px; }
    .project-name { font-size: 14px; }
    .project-meta { font-size: 12px; }
    
    .related-title { font-size: 15px; }
    .related-name { font-size: 13px; }
    .related-sci { font-size: 11px; }
    
    .quick-stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .stat-item { flex-direction: column; gap: 4px; text-align: center; }
    .stat-icon { width: 38px; height: 38px; font-size: 17px; }
    .stat-text { align-items: center; }
    .stat-label { display: none; }
    
    .related-grid { grid-template-columns: 1fr; }
    
    .lightbox-main { padding: 0; }
    .lightbox-image { border-radius: 0; }
    .lightbox-nav { opacity: 1; width: 40px; height: 40px; font-size: 18px; }
    .lightbox-nav.prev { left: 8px; }
    .lightbox-nav.next { right: 8px; }
    .lightbox-thumbs { display: none; }
    .lightbox-counter { opacity: 1; bottom: 12px; }
    .lightbox-close { top: 12px; right: 12px; }
    
    .sticky-action-bar { padding: 10px 14px; gap: 10px; }
    .btn-primary { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
    .btn-primary span { display: none; }
    .btn-icon { width: 42px; height: 42px; }
    .btn svg { width: 18px; height: 18px; }
    .action-bar-name-mobile { display: block; }
}

@media (max-width: 480px) {
    :root {
        --space-sm: 12px;
        --space-md: 16px;
        --space-lg: 24px;
    }
    
    .image-panel { height: 50vh; }
    .image-bottom-bar { bottom: 10px; left: 10px; right: 10px; }
    .nav-btn { width: 38px; height: 38px; }
    .nav-btn svg { width: 16px; height: 16px; }
    .mode-btn { padding: 5px 10px; font-size: 10px; }
    .image-counter { font-size: 10px; }
    
    .hero-section { padding-bottom: var(--space-sm); margin-bottom: var(--space-sm); }
    .hero-badges { gap: 6px; margin-bottom: 12px; }
    .badge { padding: 5px 10px; font-size: 11px; }
    .hero-code { font-size: 12px; }
    .hero-title { font-size: 24px; }
    .hero-subtitle { font-size: 15px; }
    .hero-extra { font-size: 13px; }
    
    .quick-stats { gap: 6px; margin-top: 12px; padding-top: 12px; }
    .stat-icon { width: 34px; height: 34px; font-size: 16px; }
    .stat-value { font-size: 12px; }
    
    .content-inner { padding: var(--space-sm); padding-bottom: 85px; }
    
    .info-cell { padding: 10px; }
    .cell-label { font-size: 10px; }
    .cell-value { font-size: 13px; }
    
    .info-row-visual { padding: 10px; gap: 5px; }
    .visual-item { padding: 5px 8px; font-size: 12px; }
    .visual-icon { font-size: 13px; }
    
    .tolerance-compact { padding: 10px; }
    .tol-label { font-size: 11px; min-width: 52px; }
    
    .tags-section { padding: 10px; }
    .tags-label { font-size: 11px; min-width: 65px; }
    .tag { font-size: 11px; padding: 4px 7px; }
    
    .description-section, .projects-section, .related-section {
        padding: var(--space-sm);
        margin-bottom: var(--space-sm);
    }
    
    .description-title, .projects-title, .related-title { font-size: 14px; }
    .description-text { font-size: 14px; }
    
    .project-card { padding: 10px; }
    .project-image { width: 50px; height: 38px; }
    .project-name { font-size: 13px; }
    .project-meta { font-size: 11px; }
    .project-arrow { display: none; }
    
    .related-content { padding: 10px; }
    .related-name { font-size: 12px; }
    .related-sci { font-size: 10px; }
    
    .sticky-action-bar { padding: 8px 12px; gap: 8px; border-radius: 16px; }
    .btn-primary, .btn-icon { width: 40px; height: 40px; }
    .btn svg { width: 18px; height: 18px; }
    .action-bar-name-mobile { font-size: 13px; }
    
    .modal-content { max-width: 100%; margin: 10px; border-radius: 16px; }
    .modal-header { padding: 14px 16px; }
    .modal-title { font-size: 16px; }
    .modal-body { padding: 16px; }
    .form-label { font-size: 12px; }
    .form-input, .form-select { padding: 12px 14px; font-size: 15px; }
    .form-row { gap: 12px; }
    .btn-auto { padding: 12px 14px; font-size: 13px; }
    .modal-footer { padding: 12px 16px; gap: 10px; }
    .modal-footer .btn { padding: 13px 16px; font-size: 14px; }
    
    .lightbox-nav { width: 44px; height: 44px; font-size: 20px; }
}


/* ================================================================
   ITEM-DETAIL ADDITIONS — Append to item-detail.css (renamed from plant-detail.css)
   Version: 6.0
   
   RENAME INSTRUCTIONS:
   1. Copy plant-detail.css → item-detail.css
   2. In item-detail.css, rename:
      .hero-scientific → .hero-subtitle
      .hero-family → .hero-extra
   3. Append THIS file's contents to the end
   ================================================================ */

/* ============================================================
   VARIANTS SECTION — Material, Drainage, Lighting
   ============================================================ */
.variants-section {
    margin-top: 24px;
}

.variants-section .section-header {
    margin-bottom: 12px;
}

.variants-section .section-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
}

.variants-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #1e293b;
}

.variants-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.variants-table thead {
    background: #0a0f1a;
}

.variants-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid #1e293b;
}

.variants-table td {
    padding: 10px 14px;
    color: #e2e8f0;
    border-bottom: 1px solid #1e293b;
    white-space: nowrap;
}

.variants-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.05);
}

.variants-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   FILES SECTION — Digital Assets
   ============================================================ */
.files-section {
    margin-top: 24px;
}

.files-section .section-header {
    margin-bottom: 12px;
}

.files-section .section-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.file-card:hover {
    border-color: #10b981;
}

.file-card:last-child {
    margin-bottom: 0;
}

.file-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-primary {
    display: inline-block;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.file-meta {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.file-download-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.file-download-btn:hover {
    background: #10b981;
    color: white;
}

/* ============================================================
   ENTITY-SPECIFIC BADGE COLORS
   ============================================================ */
.badge-outdoor {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.badge-pool {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.badge-spec {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.badge-feature {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-placement {
    background: rgba(244, 114, 182, 0.15);
    color: #f472b6;
}

/* Tag links — for Lighting datasheet/product URL */
.tag-link {
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-link:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #10b981;
}

/* ============================================================
   RESPONSIVE — Variants & Files
   ============================================================ */
@media (max-width: 768px) {
    .variants-table th,
    .variants-table td {
        padding: 8px 10px;
        font-size: 11px;
    }

    .file-card {
        flex-wrap: wrap;
        gap: 10px;
    }

    .file-download-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   COMBO RELATED CARDS — on Plant Detail page
   Bổ sung vào cuối item-detail.css
   ============================================================ */

/* Score badge trên combo card trong related grid */
.combo-related-card .related-image {
    position: relative;
}

.combo-card-score {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    line-height: 1;
}

.combo-card-score.high { background: rgba(74,222,128,0.85); color: #064e3b; }
.combo-card-score.mid  { background: rgba(251,191,36,0.85); color: #78350f; }
.combo-card-score.low  { background: rgba(248,113,113,0.85); color: #7f1d1d; }
