/* VaultView - Collectibles Management System - Main Stylesheet */

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 1400px;
    width: 98%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.6;
}

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

/* Header Styles */
header {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

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

.header-title h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.header-title p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.header-stats {
    display: flex;
    gap: 2rem;
    text-align: center;
    align-items: center;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Authentication Controls */
.auth-controls {
    margin-left: auto;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.logout-btn i {
    width: 16px;
    height: 16px;
}

/* Tab Navigation */
.tabs {
    display: flex;
    background: white;
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    background: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tab.active {
    background: #fbbf24;
    color: white;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

.tab:hover:not(.active) {
    background: #f3f4f6;
}

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    position: relative;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    ring: 2px solid #fbbf24;
    border-color: #fbbf24;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    font-size: 1rem;
    min-width: 150px;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #fbbf24;
    color: white;
}

.btn-primary:hover {
    background: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    justify-content: center;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-actions {
    display: flex;
    gap: 0.25rem;
}

.card-info {
    space-y: 0.5rem;
}

.info-row {
    display: flex;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.info-label {
    font-weight: 500;
    color: #374151;
    min-width: 80px;
}

.info-value {
    color: #6b7280;
}

.value-highlight {
    font-weight: 600;
    color: #059669;
}

/* Rarity Badges */
.rarity-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.rarity-common { background: #f3f4f6; color: #374151; }
.rarity-uncommon { background: #dbeafe; color: #1e40af; }
.rarity-rare { background: #fef3c7; color: #92400e; }
.rarity-very-rare { background: #fed7d7; color: #c53030; }
.rarity-ultra-rare { background: #e9d5ff; color: #7c2d12; }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    max-width: 1400px;
    width: 98%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    ring: 2px solid #fbbf24;
    border-color: #fbbf24;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Form Sections */
.form-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    background: #f9fafb;
}

.section-title {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 0.5rem;
}

/* Tag and Character Selection Styles */
.tag-item, .character-item {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin: 0.125rem;
    cursor: pointer;
}

.tag-item .remove, .character-item .remove {
    margin-left: 0.5rem;
    cursor: pointer;
    opacity: 0.8;
}

.tag-item .remove:hover, .character-item .remove:hover {
    opacity: 1;
}

/* Category-specific field styles */
.category-field {
    border-left: 3px solid #fbbf24;
    padding-left: 1rem;
    background: #fffbeb;
}

/* Image Thumbnail Styles */
.image-preview-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    align-items: flex-start;
    overflow-x: auto;
    padding: 0.5rem;
    margin: -0.5rem;
}

.image-thumbnail-container {
    position: relative;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s;
    width: 100px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.image-thumbnail-container:hover {
    border-color: #fbbf24;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.image-thumbnail-container.featured-image {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.image-thumbnail-container.featured-image:hover {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-thumbnail-wrapper {
    width: 100px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.featured-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    z-index: 10;
}

.image-thumbnail {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.image-remove-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.image-remove-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.image-info {
    padding: 0.375rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.image-filename {
    font-size: 0.5rem;
    color: #374151;
    font-weight: 500;
    margin: 0 0 0.125rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.image-size {
    font-size: 0.4rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.2;
}

/* Analysis Status Styles */
.analysis-status {
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-direction: column;
    line-height: 1.4;
}

.analysis-status.analyzing {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.analysis-status.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.analysis-status.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.analysis-status.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Analysis Progress Styles */
.analysis-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.analysis-progress-fill {
    height: 100%;
    background: currentColor;
    border-radius: 2px;
    transition: width 0.3s ease;
    opacity: 0.7;
}

.analysis-status small {
    font-size: 0.75rem;
    opacity: 0.8;
    line-height: 1.3;
}

.analysis-status .status-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

/* Animation for analyzing state */
.analysis-status.analyzing .status-main i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Category Selection Styles */
.category-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.category-card:hover {
    border-color: #fbbf24;
    background: #fffbeb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card.selected {
    border-color: #f59e0b;
    background: #fef3c7;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.category-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem auto;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.category-card:hover .category-icon {
    background: #fbbf24;
    color: white;
}

.category-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.category-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.stat-card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-title {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: bold;
    color: #111827;
}

.stat-card-icon {
    width: 2rem;
    height: 2rem;
    opacity: 0.7;
}

/* Utility Classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Loading state styling */
.loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.loading-icon {
    width: 3rem;
    height: 3rem;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
    color: #3b82f6;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fade in animation for content */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Multi-Image Upload Styles */
.image-preview-container {
    position: relative;
    display: inline-block;
}

.image-preview-container:hover .remove-image-btn {
    opacity: 1;
}

.remove-image-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.remove-image-btn:hover {
    background: #dc2626 !important;
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        text-align: center;
    }

    .header-stats {
        justify-content: center;
        width: 100%;
    }

    .controls {
        flex-direction: column;
    }

    .view-controls {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    .sort-controls {
        justify-content: center;
        width: 100%;
    }

    .sort-controls select {
        flex: 1;
        max-width: 200px;
    }

    .view-toggle {
        justify-content: center;
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }
}

/* Tag Badge Styles */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.tag-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tag-badge:hover {
    background: #bfdbfe;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.25);
}

/* View Controls Layout */
.view-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Sort Controls Styles */
.sort-controls {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.sort-direction-btn {
    padding: 0.75rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #6b7280;
    transition: all 0.2s;
}

.sort-direction-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.sort-direction-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Sortable Table Headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.sortable-header:hover {
    background: #f9fafb;
}

.sortable-header[data-sort] {
    background: #f9fafb;
}

.sortable-header.sort-active {
    background: #eff6ff;
    color: #1e40af;
}

.sort-icon {
    width: 12px;
    height: 12px;
    margin-left: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.sortable-header:hover .sort-icon,
.sortable-header.sort-active .sort-icon {
    opacity: 1;
}

.sortable-header.sort-active .sort-icon {
    color: #1e40af;
}

/* View Toggle Styles */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin: 0 0.5rem;
}

.view-toggle-btn {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.view-toggle-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.view-toggle-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Table View Styles */
.table-view {
    width: 100%;
    margin-top: 1rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: white;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.items-table th {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.items-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.items-table tr:hover {
    background: #f9fafb;
    cursor: pointer;
}

.items-table tr.empty-row:hover {
    background: transparent;
    cursor: default;
}

.table-image {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    border-radius: 0.25rem;
}

.table-image-placeholder {
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.table-actions .btn {
    padding: 0.25rem;
    min-width: auto;
}

/* Item Summary Modal Styles */
.summary-content {
    max-height: 70vh;
    overflow-y: auto;
}

.summary-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.summary-basic-info {
    flex: 1;
}

.summary-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.summary-section {
    margin-bottom: 2rem;
}

.summary-section-title {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-field.full-width {
    grid-column: 1 / -1;
}

.summary-field label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.summary-field span {
    color: #6b7280;
    word-break: break-word;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: 1px solid #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Summary Image Gallery Styles */
.summary-image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.summary-image-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    transition: all 0.2s;
    cursor: pointer;
}

.summary-image-item:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.summary-image-item.featured {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.summary-image-item img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    display: block;
}

.summary-image-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Ensure Category Selection Modal is very wide */
#categorySelectionModal .modal-content {
    max-width: 1400px !important;
    width: 98% !important;
}

/* Fix button widths - ensure buttons are not full width */
.modal .btn,
.modal button {
    width: auto !important;
    max-width: 200px;
    min-width: auto;
}

/* Exception for specific buttons that should be wider */
.modal .btn-primary.save-btn,
.modal .btn-primary[onclick*="save"] {
    max-width: 250px;
}

/* Modal button containers should not stretch buttons */
.modal-footer .btn,
.modal .btn-group .btn {
    flex: 0 0 auto;
}

/* Gallery View Styles */
.gallery-view {
    width: 100%;
    margin-top: 1rem;
}

.gallery-container {
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: white;
}

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

.gallery-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-align: center;
    padding: 1rem;
}

.gallery-placeholder-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.5rem;
}

.gallery-placeholder-text {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    word-break: break-word;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 1.5rem 1rem 1rem;
    transform: translateY(100%);
    transition: transform 0.2s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
    word-break: break-word;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .gallery-item-overlay {
        position: static;
        transform: none;
        background: rgba(0, 0, 0, 0.8);
        padding: 0.5rem;
    }
    
    .gallery-item-name {
        font-size: 0.75rem;
    }
}

/* User Info Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    position: relative;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.user-email {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: background-color 0.2s;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    min-width: 160px;
    z-index: 50;
    display: none;
}

.user-dropdown.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f9fafb;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.logout-item {
    color: #dc2626;
    border-top: 1px solid #e5e7eb;
}

.logout-item:hover {
    background-color: #fef2f2;
}

/* Hide old logout button when user info is shown */
.auth-controls .logout-btn {
    background: rgba(220, 38, 38, 0.1);
    color: white;
    border: 1px solid rgba(220, 38, 38, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.auth-controls .logout-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
}

@media (max-width: 768px) {
    .user-info {
        padding: 6px 8px;
        gap: 8px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .user-email {
        font-size: 11px;
    }
    
    .user-details {
        display: none;
    }
}

/* Custom Fields Styles */
.custom-fields-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.custom-fields-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-fields-section h4::before {
    content: "🔧";
    font-size: 14px;
}

.custom-fields-container {
    display: grid;
    gap: 1rem;
}

.custom-fields-container .form-group {
    margin-bottom: 0;
}

.custom-fields-container .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-fields-container .checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.custom-fields-container .checkbox-group label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Custom field type indicators */
.custom-field-type-indicator {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
    margin-left: 4px;
}

/* Summary section custom fields */
.summary-custom-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.summary-custom-fields h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-custom-fields h5::before {
    content: "🔧";
    font-size: 12px;
}

.summary-custom-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.summary-custom-field:last-child {
    border-bottom: none;
}

.summary-custom-field label {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.875rem;
}

.summary-custom-field span {
    color: #374151;
    font-size: 0.875rem;
    text-align: right;
    max-width: 60%;
    word-wrap: break-word;
}