/* Collection Page Specific Styles */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One:wght@400&family=Comfortaa:wght@300;400;700&family=Nunito:wght@400;600;700;800&family=Pacifico&display=swap');

.collection-header {
    margin-top: 70px;
    background: linear-gradient(135deg, var(--black) 0%, #1a1a1a 100%);
    color: var(--white);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.collection-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--white), var(--gray-light), var(--white));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

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

.collection-title {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-transform: none;
    color: var(--white);
}

.collection-subtitle {
    font-family: 'Comfortaa', cursive;
    font-size: 1.2rem;
    color: #cccccc;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Collection Main Layout */
.collection-main {
    background-color: var(--gray-light);
    padding: 2rem 0;
    min-height: 100vh;
}

.collection-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
}

/* Collection Content */
.collection-content {
    width: 100%;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.collection-item {
    background-color: var(--white);
    border: 3px solid var(--black);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.collection-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    border-color: var(--gray-dark);
}

.collection-item.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
    transform: translateY(-5px);
}

.item-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.3s ease;
}

.collection-item:hover .item-image img {
    transform: scale(1.05);
}

.item-info {
    padding: 1.5rem;
    background-color: var(--white);
}

.item-name {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: none;
    color: var(--black);
}

.item-type {
    font-family: 'Comfortaa', cursive;
    font-size: 0.9rem;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.item-description {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: #333333;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-weight: 400;
}

.ownership-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background-color: var(--gray-light);
    border-radius: 10px;
    border: 2px solid var(--black);
}

.count-number {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--black);
    min-width: 30px;
    text-align: center;
}

.count-label {
    font-family: 'Comfortaa', cursive;
    font-size: 0.9rem;
    color: var(--gray-dark);
    text-transform: none;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Ownership Sidebar */
.ownership-sidebar {
    background-color: var(--white);
    border: 3px solid var(--black);
    border-radius: 20px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 90px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.sidebar-header {
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.sidebar-header h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--black);
    text-transform: none;
    letter-spacing: 0.5px;
}

.sidebar-header p {
    font-family: 'Comfortaa', cursive;
    font-size: 0.9rem;
    color: var(--gray-dark);
    font-weight: 400;
    margin-bottom: 1rem;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.owner-search {
    flex: 1;
    padding: 0.7rem;
    border: 2px solid var(--black);
    border-radius: 8px;
    font-family: 'Comfortaa', cursive;
    font-size: 0.9rem;
    background-color: var(--white);
    color: var(--black);
    transition: all 0.3s ease;
}

.owner-search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.owner-search::placeholder {
    color: var(--gray-medium);
    font-family: 'Comfortaa', cursive;
}

.clear-search {
    padding: 0.7rem 1rem;
    background-color: var(--black);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: 'Comfortaa', cursive;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background-color: var(--gray-dark);
    transform: translateY(-1px);
}

.clear-search:active {
    transform: translateY(0);
}

/* Search Results */
.search-results {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background-color: var(--gray-light);
    border-radius: 8px;
    border: 2px solid var(--black);
}

.search-results h4 {
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--black);
}

.search-results p {
    font-family: 'Comfortaa', cursive;
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin: 0;
}

.search-match {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    margin-bottom: 0.8rem;
}

.search-match .owner-name {
    background-color: #ffc107;
    color: var(--black);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
}

.no-search-results {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-dark);
    font-family: 'Comfortaa', cursive;
    font-style: italic;
}

/* Search highlight styling */
mark {
    background-color: #ffc107;
    color: var(--black);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: bold;
}

.owners-scroll-view {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.owners-scroll-view::-webkit-scrollbar {
    width: 6px;
}

.owners-scroll-view::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 3px;
}

.owners-scroll-view::-webkit-scrollbar-thumb {
    background: var(--gray-dark);
    border-radius: 3px;
}

.owners-scroll-view::-webkit-scrollbar-thumb:hover {
    background: var(--black);
}

.no-selection {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-dark);
    font-family: 'Comfortaa', cursive;
    font-weight: 400;
    font-size: 1rem;
}

.no-owners {
    text-align: center;
    padding: 2rem 1rem;
}

.no-owners h4 {
    font-family: 'Fredoka One', cursive;
    color: var(--black);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.no-owners p {
    font-family: 'Comfortaa', cursive;
    color: var(--gray-dark);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.owner-card {
    background-color: var(--white);
    border: 2px solid var(--black);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

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

.owner-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.owner-location {
    font-family: 'Comfortaa', cursive;
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-bottom: 0.3rem;
    font-weight: 400;
}

.owner-date {
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    color: var(--gray-medium);
    font-style: italic;
    font-weight: 400;
}

/* Responsive Design */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .collection-container {
        max-width: 1600px;
        gap: 4rem;
    }
    
    .collection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .ownership-sidebar {
        width: 400px;
    }
}

/* Desktop (1200px - 1439px) */
@media (max-width: 1439px) and (min-width: 1200px) {
    .collection-container {
        padding: 0 30px;
    }
    
    .collection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Tablet Landscape (1024px - 1199px) */
@media (max-width: 1199px) and (min-width: 1024px) {
    .collection-container {
        grid-template-columns: 1fr 320px;
        gap: 2.5rem;
        padding: 0 25px;
    }
    
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .ownership-sidebar {
        width: 320px;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .collection-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 20px;
    }
    
    .ownership-sidebar {
        position: static;
        order: -1;
        width: 100%;
        max-width: 600px;
        margin: 0 auto 2rem auto;
    }
    
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .collection-title {
        font-size: 2.5rem;
    }
    
    .collection-subtitle {
        font-size: 1.1rem;
    }
    
    .item-image {
        height: 280px;
    }
    
    .owners-scroll-view {
        max-height: 250px;
    }
}

/* Mobile Landscape (640px - 767px) */
@media (max-width: 767px) and (min-width: 640px) {
    .collection-header {
        padding: 2.5rem 1.5rem;
        margin-top: 70px;
    }
    
    .collection-title {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .collection-subtitle {
        font-size: 1rem;
    }
    
    .collection-container {
        padding: 0 15px;
        gap: 1.5rem;
        grid-template-columns: 1fr;
    }
    
    .ownership-sidebar {
        order: -1;
        position: static;
        width: 100%;
        max-width: none;
        margin-bottom: 2rem;
    }
    
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    .item-image {
        height: 220px;
    }
    
    .item-info {
        padding: 1.2rem;
    }
    
    .ownership-sidebar {
        padding: 1.2rem;
        border-radius: 15px;
    }
    
    .owners-scroll-view {
        max-height: 200px;
    }
    
    .sidebar-header h3 {
        font-size: 1.2rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .owner-search {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .clear-search {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}

/* Mobile Portrait (480px - 639px) */
@media (max-width: 639px) and (min-width: 480px) {
    .collection-header {
        padding: 2rem 1rem;
        margin-top: 70px;
    }
    
    .collection-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
    
    .collection-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .collection-container {
        padding: 0 15px;
        gap: 1.5rem;
        grid-template-columns: 1fr;
    }
    
    .ownership-sidebar {
        order: -1;
        position: static;
        width: 100%;
        max-width: none;
        margin-bottom: 2rem;
    }
    
    .collection-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .collection-item {
        border-radius: 15px;
        border-width: 2px;
    }
    
    .item-image {
        height: 250px;
    }
    
    .item-image img {
        padding: 15px;
    }
    
    .item-info {
        padding: 1rem;
    }
    
    .item-name {
        font-size: 1.3rem;
    }
    
    .item-type {
        font-size: 0.85rem;
    }
    
    .item-description {
        font-size: 0.9rem;
    }
    
    .ownership-count {
        padding: 0.7rem;
        border-radius: 8px;
    }
    
    .count-number {
        font-size: 1.4rem;
    }
    
    .count-label {
        font-size: 0.85rem;
    }
    
    .ownership-sidebar {
        padding: 1rem;
        border-radius: 15px;
        border-width: 2px;
    }
    
    .sidebar-header h3 {
        font-size: 1.1rem;
    }
    
    .sidebar-header p {
        font-size: 0.85rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 0.3rem;
        margin-top: 0.8rem;
    }
    
    .owner-search {
        padding: 0.5rem;
        font-size: 0.8rem;
        border-radius: 6px;
    }
    
    .clear-search {
        padding: 0.5rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }
    
    .owners-scroll-view {
        max-height: 250px;
    }
    
    .owner-card {
        padding: 0.8rem;
        border-radius: 12px;
        margin-bottom: 0.8rem;
    }
    
    .owner-name {
        font-size: 0.95rem;
    }
    
    .owner-location {
        font-size: 0.8rem;
    }
    
    .owner-date {
        font-size: 0.75rem;
    }
}

/* Small Mobile (360px - 479px) */
@media (max-width: 479px) and (min-width: 360px) {
    .collection-header {
        padding: 1.5rem 1rem;
        margin-top: 70px;
    }
    
    .collection-title {
        font-size: 1.6rem;
        letter-spacing: 1.5px;
    }
    
    .collection-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .collection-container {
        padding: 0 12px;
        gap: 1.2rem;
        grid-template-columns: 1fr;
    }
    
    .ownership-sidebar {
        order: -1;
        position: static;
        width: 100%;
        max-width: none;
        margin-bottom: 1.5rem;
    }
    
    .collection-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .collection-item {
        border-radius: 12px;
        border-width: 2px;
    }
    
    .item-image {
        height: 220px;
    }
    
    .item-image img {
        padding: 12px;
    }
    
    .item-info {
        padding: 0.9rem;
    }
    
    .item-name {
        font-size: 1.2rem;
        margin-bottom: 0.4rem;
    }
    
    .item-type {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }
    
    .item-description {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
    }
    
    .ownership-count {
        padding: 0.6rem;
        border-radius: 8px;
    }
    
    .count-number {
        font-size: 1.3rem;
    }
    
    .count-label {
        font-size: 0.8rem;
    }
    
    .ownership-sidebar {
        padding: 0.9rem;
        border-radius: 12px;
        border-width: 2px;
    }
    
    .sidebar-header {
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
    }
    
    .sidebar-header h3 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }
    
    .sidebar-header p {
        font-size: 0.8rem;
    }
    
    .owners-scroll-view {
        max-height: 200px;
        padding-right: 5px;
    }
    
    .no-selection,
    .no-owners {
        padding: 1.5rem 0.8rem;
    }
    
    .no-owners h4 {
        font-size: 1rem;
    }
    
    .no-owners p {
        font-size: 0.85rem;
    }
    
    .owner-card {
        padding: 0.7rem;
        border-radius: 10px;
        margin-bottom: 0.7rem;
        border-width: 2px;
    }
    
    .owner-name {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .owner-location {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .owner-date {
        font-size: 0.7rem;
    }
}

/* Extra Small Mobile (320px - 359px) */
@media (max-width: 359px) {
    .collection-header {
        padding: 1.2rem 0.8rem;
        margin-top: 70px;
    }
    
    .collection-title {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    
    .collection-subtitle {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .collection-container {
        padding: 0 10px;
        gap: 1rem;
        grid-template-columns: 1fr;
    }
    
    .ownership-sidebar {
        order: -1;
        position: static;
        width: 100%;
        max-width: none;
        margin-bottom: 1rem;
    }
    
    .collection-grid {
        gap: 0.8rem;
    }
    
    .collection-item {
        border-radius: 10px;
    }
    
    .item-image {
        height: 200px;
    }
    
    .item-image img {
        padding: 10px;
    }
    
    .item-info {
        padding: 0.8rem;
    }
    
    .item-name {
        font-size: 1.1rem;
    }
    
    .item-type {
        font-size: 0.75rem;
    }
    
    .item-description {
        font-size: 0.8rem;
    }
    
    .ownership-count {
        padding: 0.5rem;
        border-radius: 6px;
    }
    
    .count-number {
        font-size: 1.2rem;
    }
    
    .count-label {
        font-size: 0.75rem;
    }
    
    .ownership-sidebar {
        padding: 0.8rem;
        border-radius: 10px;
    }
    
    .sidebar-header h3 {
        font-size: 0.95rem;
    }
    
    .sidebar-header p {
        font-size: 0.75rem;
    }
    
    .owners-scroll-view {
        max-height: 180px;
    }
    
    .owner-card {
        padding: 0.6rem;
        border-radius: 8px;
        margin-bottom: 0.6rem;
    }
    
    .owner-name {
        font-size: 0.85rem;
    }
    
    .owner-location {
        font-size: 0.7rem;
    }
    
    .owner-date {
        font-size: 0.65rem;
    }
}

/* Additional responsive optimizations for Collection Ownership */

/* Ensure proper spacing and touch targets */
.collection-item {
    min-height: 44px; /* Minimum touch target size */
    position: relative;
}

/* Improve mobile navigation */
@media (max-width: 767px) {
    .navbar {
        padding: 0.7rem 0;
    }
    
    .nav-links {
        gap: 0.8rem;
    }
    
    .nav-links a {
        padding: 0.3rem 0.5rem;
        border-radius: 4px;
        transition: background-color 0.3s ease;
    }
    
    .nav-links a:hover,
    .nav-links a:focus {
        background-color: var(--gray-light);
    }
}

/* Improve scrollbar on mobile */
@media (max-width: 767px) {
    .owners-scroll-view::-webkit-scrollbar {
        width: 4px;
    }
    
    .owners-scroll-view::-webkit-scrollbar-thumb {
        background: var(--gray-medium);
        border-radius: 2px;
    }
}

/* Loading states and animations */
.collection-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.collection-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--gray-light);
    border-top: 2px solid var(--black);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Improve focus states for accessibility */
.collection-item:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.owner-card:focus {
    outline: 2px solid #007bff;
    outline-offset: 1px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .collection-item {
        border-width: 3px;
    }
    
    .owner-card {
        border-width: 3px;
    }
    
    .ownership-sidebar {
        border-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .collection-item,
    .owner-card,
    .collection-item img {
        transition: none;
    }
    
    .collection-item:hover {
        transform: none;
    }
    
    .owner-card:hover {
        transform: none;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    :root {
        --background-dark: #1a1a1a;
        --text-dark: #ffffff;
        --border-dark: #ffffff;
    }
    
    /* Uncomment when dark mode is implemented
    .collection-item {
        background-color: var(--background-dark);
        border-color: var(--border-dark);
        color: var(--text-dark);
    }
    */
}

/* Print styles */
@media print {
    .collection-header,
    .ownership-sidebar {
        display: none;
    }
    
    .collection-container {
        grid-template-columns: 1fr;
    }
    
    .collection-item {
        break-inside: avoid;
        border: 2px solid #000;
        margin-bottom: 1rem;
    }
    
    .item-image {
        height: auto;
    }
}

/* Item Search Styles */
.item-search-container {
    background-color: var(--white);
    border: 3px solid var(--black);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.item-search-container h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--black);
    text-transform: none;
    letter-spacing: 0.5px;
    text-align: center;
}

.item-search {
    flex: 1;
    padding: 0.7rem;
    border: 2px solid var(--black);
    border-radius: 8px;
    font-family: 'Comfortaa', cursive;
    font-size: 0.9rem;
    background-color: var(--white);
    color: var(--black);
    transition: all 0.3s ease;
}

.item-search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.item-search::placeholder {
    color: var(--gray-medium);
    font-family: 'Comfortaa', cursive;
}

/* Responsive adjustments for item search */
@media (max-width: 768px) {
    .item-search-container {
        padding: 1.2rem;
        border-radius: 15px;
        margin-bottom: 1.5rem;
    }
    
    .item-search-container h3 {
        font-size: 1.2rem;
    }
    
    .item-search {
        padding: 0.6rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .item-search-container {
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 1.2rem;
    }
    
    .item-search-container h3 {
        font-size: 1.1rem;
    }
    
    .item-search {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}