/**
 * Modern Listing Page Design for AppsZeal
 * Enhanced UI/UX for HR & Employee Management and other listing pages
 */

/* ==========================================================================
   Modern Variables and Root Styles
   ========================================================================== */

:root {
    /* Modern Color Palette */
    --primary-color: #5E72E4;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #F7FAFC;
    --accent-color: #48BB78;
    --danger-color: #F56565;
    --warning-color: #ED8936;
    --info-color: #4299E1;
    
    /* Neutral Colors */
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-muted: #A0AEC0;
    --border-color: #E2E8F0;
    --background-light: #F7FAFC;
    --background-white: #FFFFFF;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 14px 28px rgba(0,0,0,0.12), 0 10px 10px rgba(0,0,0,0.08);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* ==========================================================================
   Modern Page Header
   ========================================================================== */

.listing-page-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 10px 0 10px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
}

.listing-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
}

.listing-page-header h1 {
    color: #1e293b;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: none;
    animation: fadeInUp 0.6s ease-out;
    line-height: 1.2;
}

.listing-page-header p {
    color: #64748b;
    font-size: 1.125rem;
    line-height: 1.75;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

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

/* ==========================================================================
   Modern Stats Bar
   ========================================================================== */

.stats-bar {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin: -2rem auto 2rem;
    max-width: 1200px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}

.stats-bar .stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-bar .stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-bar .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Modern Software Cards
   ========================================================================== */

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.software-card {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.software-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.software-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

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

.software-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.software-logo {
    width: 60px;
    height: 95px;
    border-radius: var(--radius-md);
    background: var(--background-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.software-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.software-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.software-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: color var(--transition-base);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.software-card:hover .software-name {
    color: var(--secondary-color);
}

.software-category {
    display: inline-block;
    background: var(--background-light);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.software-description {
    /* color: var(--text-secondary); */
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    font-size: 0.9rem;
}

.software-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    margin-top: auto;
}

.feature-tag {
    background: var(--background-light);
    color: var(--secondary-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.software-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    flex-shrink: 0;
}

.software-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    color: #FFC107;
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.software-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-view {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
}

.btn-view:hover {
    background: #4C63D2;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-compare {
    background: transparent;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-base);
    border: 1px solid var(--primary-color);
    cursor: pointer;
}

.btn-compare:hover {
    background: var(--primary-color);
    color: white;
}

/* ==========================================================================
   Modern Filter Section
   ========================================================================== */

.modern-filters {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

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

.filter-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-chip {
    background: var(--background-light);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-chip:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==========================================================================
   Modern Pagination
   ========================================================================== */

.modern-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-base);
    cursor: pointer;
}

.pagination-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading-card {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-line {
    height: 1rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

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

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .listing-page-header h1 {
        font-size: 2rem;
    }
    
    .software-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .filter-chips {
        justify-content: center;
    }
    
    .software-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .software-actions {
        flex-direction: column;
    }
    
    .btn-view,
    .btn-compare {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F7FAFC;
        --text-secondary: #CBD5E0;
        --text-muted: #718096;
        --background-light: #2D3748;
        --background-white: #F7FAFC;
        --border-color: #4A5568;
    }
    
    .software-card,
    .modern-filters,
    .stats-bar {
        background: var(--background-white);
    }
    
    .software-category,
    .filter-chip {
        background: var(--background-light);
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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

/* ==========================================================================
   Utility Classes
   ========================================================================== */

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
