/* File Repository Frontend Styles - Modern Design */

.file-repository {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #f093fb;
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #4ecdc4;
    --success-gradient: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    --warning-color: #ffeaa7;
    --warning-gradient: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    --dark-color: #2d3436;
    --light-color: #ffffff;
    --border-radius: 15px;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* List Style - Modern Card Design */
.file-repository[data-style="list"] .file-item {
    display: flex;
    align-items: center;
    padding: 25px;
    margin-bottom: 25px;
    background: var(--light-color);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.file-repository[data-style="list"] .file-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.file-repository[data-style="list"] .file-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.file-repository[data-style="list"] .file-item:hover::before {
    width: 8px;
}

.file-repository[data-style="list"] .file-thumbnail {
    flex-shrink: 0;
    margin-right: 25px;
    position: relative;
}

.file-repository[data-style="list"] .file-thumbnail img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.file-repository[data-style="list"] .file-item:hover .file-thumbnail img {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.file-repository[data-style="list"] .file-content {
    flex-grow: 1;
}

.file-repository[data-style="list"] .file-item h3 {
    margin: 0 0 12px 0;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--dark-color);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
}

/* Grid Style - Modern Card Grid */
.file-repository[data-style="grid"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.file-repository[data-style="grid"] .file-item {
    background: var(--light-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 0;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.file-repository[data-style="grid"] .file-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.file-repository[data-style="grid"] .file-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

.file-repository[data-style="grid"] .file-item:hover::before {
    height: 6px;
}

.file-repository[data-style="grid"] .file-thumbnail {
    padding: 25px 25px 0;
    position: relative;
}

.file-repository[data-style="grid"] .file-thumbnail img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    border: 4px solid var(--light-color);
}

.file-repository[data-style="grid"] .file-item:hover .file-thumbnail img {
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
}

.file-repository[data-style="grid"] .file-item h3 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--dark-color);
    padding: 0 20px;
}

.file-repository[data-style="grid"] .file-content {
    padding: 0 25px 25px;
}

/* Compact Style - Sleek Minimal Design */
.file-repository[data-style="compact"] .file-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    margin-bottom: 15px;
    background: var(--light-color);
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.file-repository[data-style="compact"] .file-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--success-gradient);
    border-radius: 0 3px 3px 0;
    transition: var(--transition);
}

.file-repository[data-style="compact"] .file-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
}

.file-repository[data-style="compact"] .file-item:hover::before {
    width: 5px;
    height: 80%;
}

.file-repository[data-style="compact"] .file-thumbnail {
    margin-right: 18px;
    flex-shrink: 0;
}

.file-repository[data-style="compact"] .file-thumbnail img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.file-repository[data-style="compact"] .file-item:hover .file-thumbnail img {
    transform: scale(1.1);
    box-shadow: var(--shadow-medium);
}

.file-repository[data-style="compact"] .file-item h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--dark-color);
    flex-grow: 1;
}

/* Common styles - Modern Typography & Elements */
.file-item h3 {
    color: var(--dark-color);
    font-weight: 700;
    line-height: 1.3;
    transition: var(--transition);
}

.file-description {
    color: #74787e;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 0.95em;
    font-weight: 400;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.85em;
}

.file-meta span {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.file-meta span::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: var(--transition);
}

.file-meta span:hover::before {
    left: 100%;
}

.file-version {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.file-size {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white !important;  
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.download-count {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white !important;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.download-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--transition);
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn::after {
    content: "⬇";
    margin-left: 8px;
    font-size: 1.1em;
    transition: var(--transition);
}

.download-btn:hover::after {
    transform: translateY(2px);
}

/* Loading state for download button */
.download-btn.loading {
    background: var(--secondary-gradient);
    cursor: not-allowed;
    transform: none;
    animation: pulse 1.5s infinite;
}

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

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .file-repository[data-style="list"] .file-item {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .file-repository[data-style="list"] .file-thumbnail {
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .file-repository[data-style="grid"] {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .file-repository[data-style="compact"] .file-item {
        padding: 15px;
    }
    
    .file-repository[data-style="compact"] .file-item h3 {
        font-size: 1em;
    }
    
    .file-meta {
        justify-content: center;
        gap: 8px;
    }
    
    .file-meta span {
        font-size: 0.75em;
        padding: 4px 8px;
    }
    
    .download-btn {
        padding: 10px 20px;
        font-size: 0.85em;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .file-repository {
        margin: 20px 0;
    }
    
    .file-repository[data-style="list"] .file-item,
    .file-repository[data-style="grid"] .file-item {
        margin-bottom: 15px;
    }
    
    .file-repository[data-style="grid"] .file-thumbnail img {
        width: 100px;
        height: 100px;
    }
}

/* Loading states & Animations */
.file-repository.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.file-repository.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Fade in animation for items */
.file-item {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.file-item:nth-child(1) { animation-delay: 0.1s; }
.file-item:nth-child(2) { animation-delay: 0.2s; }
.file-item:nth-child(3) { animation-delay: 0.3s; }
.file-item:nth-child(4) { animation-delay: 0.4s; }
.file-item:nth-child(5) { animation-delay: 0.5s; }
.file-item:nth-child(n+6) { animation-delay: 0.6s; }

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

/* No files message - Enhanced */
.file-repository-empty {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: var(--border-radius);
    margin: 30px 0;
}

.file-repository-empty::before {
    content: "📁";
    font-size: 4em;
    display: block;
    margin-bottom: 20px;
    opacity: 0.5;
}

.file-repository-empty p {
    color: #74787e;
    font-size: 1.1em;
    margin: 0;
    font-weight: 500;
}

/* Modern File Type Icons */
.file-item[data-type="exe"] {
    position: relative;
}

.file-item[data-type="exe"]::after {
    content: "EXE";
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: var(--shadow-light);
}

.file-item[data-type="msi"]::after {
    content: "MSI";
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: var(--shadow-light);
}

/* Hover effects for better interactivity */
.file-item:hover .file-meta span {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .file-repository {
        --light-color: #2d3748;
        --dark-color: #f7fafc;
        --border-color: #4a5568;
    }
    
    .file-item {
        background: var(--light-color);
        color: var(--dark-color);
    }
    
    .file-description {
        color: #a0aec0;
    }
}

/* Glassmorphism effect for modern browsers */
@supports (backdrop-filter: blur(10px)) {
    .file-meta span {
        background: rgba(255, 255, 255, 0.25);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.18);
    }
    
    .file-meta .file-version {
        background: rgba(102, 126, 234, 0.25);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(102, 126, 234, 0.18);
        color: #667eea !important;
    }
    
    .file-meta .file-size {
        background: rgba(240, 147, 251, 0.25);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(240, 147, 251, 0.18);
        color: #f093fb !important;
    }
    
    .file-meta .download-count {
        background: rgba(78, 205, 196, 0.25);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(78, 205, 196, 0.18);
        color: #4ecdc4 !important;
    }
}

/* Smooth transitions for better performance */
* {
    backface-visibility: hidden;
    perspective: 1000;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .file-item {
        border: 2px solid var(--dark-color);
    }
    
    .download-btn {
        border: 2px solid white;
    }
}
