/* css/AllDemoList.css - FIXED */
.demo-list-section {
    padding: 2rem 0;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
    width: 100%;
}

.demo-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.demo-card:hover::before {
    transform: scaleX(1);
}

.demo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    margin-bottom: 1.25rem;
    position: relative;
    padding-right: 80px;
}

.demo-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.demo-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Corner Ribbon Tag */
.corner-ribbon {
    position: absolute;
    top: 15px;
    right: -35px;
    padding: 0.4rem 2.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.ribbon-basic {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.ribbon-premium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.ribbon-popular {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.template-slider {
    position: relative;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    padding: 0.75rem;
}

.slider-container {
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 300%;
}

.slide-item {
    flex: 0 0 33.333%;
    padding: 0 0.15rem;
    position: relative;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    aspect-ratio: 1 / 1;
}

.slide-item img:hover {
    transform: scale(1.02);
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--primary);
    transition: var(--transition);
    z-index: 2;
}

.slider-nav:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.slider-nav.prev {
    left: 0.75rem;
}

.slider-nav.next {
    right: 0.75rem;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.slider-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: var(--transition);
}

.slider-dots .dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

/* View All Icon */
.view-all-icon {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
    z-index: 3;
}

.view-all-icon:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.demo-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-group {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.link-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.link-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.link-button.admin {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
}

.link-button.admin:hover {
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

.credentials {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
}

.credential-item span {
    color: var(--text-light);
    min-width: 70px;
    font-size: 0.8rem;
}

.credential-item code {
    background: #e2e8f0;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    flex: 1;
    font-size: 0.8rem;
}

.copy-btn {
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.3rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.8rem;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    margin-bottom: 5px;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text);
}

.copy-btn.copied .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 0.5rem;
    border: 2px solid var(--primary-light);
}

.search-results.active {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.search-result-item:hover {
    background: #f8fafc;
    border-left-color: var(--primary);
    transform: translateX(5px);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.search-result-description {
    font-size: 0.85rem;
    color: var(--text-light);
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    width: 95%;
    height: 95%;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.lightbox-slider {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.lightbox-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.lightbox-track img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    flex: 0 0 100%;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .demo-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .demo-card {
        padding: 1rem;
        margin: 0;
    }
    
    .demo-title {
        font-size: 1.3rem;
    }
    
    .template-slider {
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .slider-nav {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .slider-nav.prev {
        left: 0.5rem;
    }
    
    .slider-nav.next {
        right: 0.5rem;
    }
    
    .view-all-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        bottom: 0.5rem;
        right: 0.5rem;
    }
    
    .slide-item img {
        aspect-ratio: 1 / 1;
    }
    
    .corner-ribbon {
        top: 12px;
        right: -30px;
        padding: 0.3rem 2rem;
        font-size: 0.7rem;
    }
}

@media (min-width: 1200px) {
    .demo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .demo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}