/**
 * TeeqCore Entity System Styles
 * 
 * Styles for the dynamic entity system frontend components
 * 
 * @package TeeqCore
 * @since 1.0.0
 */

/* =============================================================================
   ENTITY COMPONENTS
   ============================================================================= */

.teeqcore-entity-list {
    display: grid;
    gap: 1.5rem;
}

.teeqcore-entity-list.layout-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .teeqcore-entity-list.layout-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .teeqcore-entity-list.layout-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.teeqcore-entity-list.layout-masonry {
    columns: 1;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .teeqcore-entity-list.layout-masonry {
        columns: 2;
    }
}

@media (min-width: 1024px) {
    .teeqcore-entity-list.layout-masonry {
        columns: 3;
    }
}

.teeqcore-entity-list.layout-list {
    grid-template-columns: 1fr;
}

/* =============================================================================
   ENTITY ITEMS
   ============================================================================= */

.teeqcore-entity-item {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.teeqcore-entity-item:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.teeqcore-entity-item.template-card {
    display: flex;
    flex-direction: column;
}

.teeqcore-entity-item.template-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1rem;
}

.teeqcore-entity-item.template-list > * + * {
    margin-left: 1rem;
}

.teeqcore-entity-item.template-minimal {
    padding: 1rem;
    text-align: center;
}

/* Entity Image */
.entity-image {
    position: relative;
    overflow: hidden;
}

.entity-image img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.entity-image img:hover {
    transform: scale(1.05);
}

.template-list .entity-image {
    flex-shrink: 0;
}

.template-list .entity-image img {
    width: 5rem;
    height: 5rem;
    border-radius: 0.5rem;
}

.template-minimal .entity-image img {
    width: 4rem;
    height: 4rem;
    margin: 0 auto;
    border-radius: 50%;
}

/* Entity Content */
.entity-content {
    padding: 1.5rem;
    flex: 1;
}

.template-list .entity-content {
    padding: 0;
}

.template-minimal .entity-content {
    padding: 1rem;
}

.entity-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.entity-title:hover {
    color: #f97316;
}

.entity-title a {
    color: inherit;
    text-decoration: none;
}

.template-list .entity-title {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.template-minimal .entity-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.entity-excerpt {
    color: #4b5563;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-minimal .entity-excerpt {
    display: none;
}

.entity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.entity-meta-item {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: #374151;
}

/* Entity Terms */
.entity-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.entity-term {
    display: inline-block;
    background: linear-gradient(to right, #f97316, #eab308);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.entity-term:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.entity-term-category {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
}

.entity-term-tag {
    background: linear-gradient(to right, #10b981, #14b8a6);
}

/* Entity Actions */
.entity-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.entity-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(to right, #f97316, #eab308);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.entity-link:hover {
    color: white;
    text-decoration: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

/* Entity Price */
.entity-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f97316;
}

.entity-price-sale {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626;
}

.entity-price-original {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

/* =============================================================================
   ENTITY FILTERS
   ============================================================================= */

.entity-filters {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.entity-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.entity-filter-group {
    display: flex;
    flex-direction: column;
}

.entity-filter-group > * + * {
    margin-top: 0.5rem;
}

.entity-filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.entity-filter-select,
.entity-filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #111827;
    font-size: 0.875rem;
}

.entity-filter-select:focus,
.entity-filter-input:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
    border-color: transparent;
}

.entity-filter-button {
    padding: 0.5rem 1rem;
    background-color: #f97316;
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.entity-filter-button:hover {
    background-color: #ea580c;
}

.entity-filter-reset {
    padding: 0.5rem 1rem;
    background-color: #6b7280;
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.entity-filter-reset:hover {
    background-color: #4b5563;
}

/* =============================================================================
   ENTITY PAGINATION
   ============================================================================= */

.entity-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.entity-pagination > * + * {
    margin-left: 0.5rem;
}

.entity-pagination a,
.entity-pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    text-decoration: none;
}

.entity-pagination a {
    background-color: #ffffff;
    color: #374151;
    transition: all 0.3s ease;
}

.entity-pagination a:hover {
    background-color: #f97316;
    color: white;
    border-color: #f97316;
}

.entity-pagination .current {
    background-color: #f97316;
    color: white;
    border-color: #f97316;
}

/* =============================================================================
   ENTITY SINGLE PAGE
   ============================================================================= */

.entity-single-header {
    margin-bottom: 2rem;
}

.entity-single-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.entity-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.entity-single-image {
    margin-bottom: 2rem;
}

.entity-single-image img {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: block;
}

.entity-single-content {
    max-width: none;
    margin-bottom: 2rem;
    line-height: 1.75;
    font-size: 1.125rem;
}

.entity-single-content h1,
.entity-single-content h2,
.entity-single-content h3,
.entity-single-content h4,
.entity-single-content h5,
.entity-single-content h6 {
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.entity-single-content p {
    margin-bottom: 1rem;
}

.entity-single-fields {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .entity-single-fields {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .entity-single-fields {
        grid-template-columns: repeat(3, 1fr);
    }
}

.entity-field {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.entity-field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.entity-field-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

/* =============================================================================
   ENTITY ARCHIVE
   ============================================================================= */

.entity-archive-header {
    text-align: center;
    margin-bottom: 3rem;
}

.entity-archive-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.entity-archive-description {
    font-size: 1.125rem;
    color: #4b5563;
    max-width: 42rem;
    margin: 0 auto;
}

.entity-no-results {
    text-align: center;
    padding: 3rem 0;
}

.entity-no-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.entity-no-results-message {
    color: #4b5563;
}

/* =============================================================================
   ENTITY FEATURED BADGE
   ============================================================================= */

.entity-featured-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(to right, #fbbf24, #f97316);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   ENTITY LOADING STATES
   ============================================================================= */

.entity-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

.entity-loading .entity-image {
    background-color: #d1d5db;
    height: 12rem;
}

.entity-loading .entity-title {
    background-color: #d1d5db;
    height: 1.5rem;
    border-radius: 0.25rem;
}

.entity-loading .entity-excerpt {
    background-color: #d1d5db;
    height: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .teeqcore-entity-list.layout-grid {
        grid-template-columns: 1fr;
    }
    
    .entity-filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .entity-filter-group {
        width: 100%;
    }
    
    .template-list {
        flex-direction: column;
    }
    
    .template-list > * + * {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .template-list .entity-image {
        flex-shrink: 1;
        display: flex;
        justify-content: center;
    }
}

/* =============================================================================
   DARK MODE SPECIFIC
   ============================================================================= */

@media (prefers-color-scheme: dark) {
    .teeqcore-entity-item {
        background-color: #1f2937;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .entity-title {
        color: white;
    }
    
    .entity-excerpt {
        color: #d1d5db;
    }
    
    .entity-meta-item {
        background-color: #374151;
        color: #d1d5db;
    }
    
    .entity-filters {
        background-color: #1f2937;
    }
    
    .entity-filter-label {
        color: #d1d5db;
    }
    
    .entity-filter-select,
    .entity-filter-input {
        background-color: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .entity-filter-select:focus,
    .entity-filter-input:focus {
        outline-color: #fb923c;
    }
    
    .entity-pagination a {
        background-color: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .entity-single-title {
        color: white;
    }
    
    .entity-single-meta {
        color: #9ca3af;
    }
    
    .entity-archive-title {
        color: white;
    }
    
    .entity-archive-description {
        color: #9ca3af;
    }
    
    .entity-no-results-title {
        color: white;
    }
    
    .entity-no-results-message {
        color: #9ca3af;
    }
    
    .entity-field {
        background-color: #1f2937;
    }
    
    .entity-field-label {
        color: #9ca3af;
    }
    
    .entity-field-value {
        color: white;
    }
    
    .entity-loading .entity-image,
    .entity-loading .entity-title,
    .entity-loading .entity-excerpt {
        background-color: #4b5563;
    }
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entity-item-fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Stagger animation for multiple items */
.entity-item-fade-in:nth-child(1) { animation-delay: 0.1s; }
.entity-item-fade-in:nth-child(2) { animation-delay: 0.2s; }
.entity-item-fade-in:nth-child(3) { animation-delay: 0.3s; }
.entity-item-fade-in:nth-child(4) { animation-delay: 0.4s; }
.entity-item-fade-in:nth-child(5) { animation-delay: 0.5s; }
.entity-item-fade-in:nth-child(6) { animation-delay: 0.6s; }

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.entity-shine {
    position: relative;
    overflow: hidden;
}

.entity-shine::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transform: translateX(-100%) skewX(-12deg);
    transition: all 0.7s ease;
}

.entity-shine:hover::before {
    opacity: 1;
    transform: translateX(100%) skewX(-12deg);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
