/**
 * FileHub My Files Page Styles
 */

.filehub-my-files-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Tabs Navigation */
.filehub-tabs-nav { margin-bottom: 2rem; border-bottom: 1px solid rgba(0,0,0,.08); }

.filehub-tabs-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.filehub-tab {
    margin: 0;
    position: relative;
}

.filehub-tab a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
    background: var(--wp--preset--color--base-2, #f9fafb);
    border-radius: 10px 10px 0 0;
    margin-right: 2px;
}

.filehub-tab a:hover { color: #374151; filter: brightness(.98); }

.filehub-tab.active a {
    color: var(--wp--preset--color--primary, #2271b1);
    background: var(--wp--preset--color--base, #ffffff);
    border-bottom-color: var(--wp--preset--color--primary, #2271b1);
    position: relative;
    z-index: 1;
}

.filehub-tab a .dashicons {
    font-size: 18px;
    line-height: 1;
}

/* Tab Content */
.filehub-tab-content {
    background: var(--wp--preset--color--base, #ffffff);
    border-radius: 0 10px 10px 10px;
    min-height: 400px;
}

.filehub-tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.filehub-tab-panel.active {
    display: block;
}

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

/* Header */
.filehub-my-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 2px solid rgba(0,0,0,.08);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right .button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.header-right .button .dashicons {
    font-size: 16px;
    line-height: 1;
}

.filehub-my-files-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 2rem;
    font-weight: 700;
}

.filehub-files-stats {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Filters */
.filehub-filters {
    background: var(--wp--preset--color--base-2, #f9fafb);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filehub-filter-form {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group .search-input {
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    background: var(--wp--preset--color--base, #ffffff);
    font-size: 0.9rem;
}

.filter-group select:focus,
.filter-group .search-input:focus { outline: none; border-color: var(--wp--preset--color--primary, #2271b1); box-shadow: 0 0 0 1px rgba(34,113,177,.2); }

.search-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Table Wrapper */
.filehub-files-table-wrapper {
    background: var(--wp--preset--color--base, #ffffff);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Table */
.filehub-files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.filehub-files-table th,
.filehub-files-table td {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.filehub-files-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.filehub-files-table th a {
    color: #374151;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.filehub-files-table th a:hover {
    color: #0073aa;
}

.sort-indicator {
    font-size: 0.8rem;
    opacity: 0.5;
}

.sort-indicator.active {
    opacity: 1;
    color: #0073aa;
}

/* Column Widths */
.col-thumbnail { width: 80px; }
.col-title { width: 25%; min-width: 200px; }
.col-status { width: 100px; }
.col-category { width: 120px; }
.col-tags { width: 150px; }
.col-downloads { width: 100px; text-align: center; }
.col-likes { width: 80px; text-align: center; }
.col-date { width: 120px; }
.col-actions { width: 120px; text-align: center; }

/* File Rows */
.file-row {
    transition: background-color 0.2s ease;
}

.file-row:hover {
    background: #f9fafb;
}

.file-row.file-status-pending {
    background: #fef3c7;
}

.file-row.file-status-draft {
    background: #fee2e2;
}

/* Thumbnail */
.file-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.file-thumbnail-placeholder {
    width: 60px;
    height: 60px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.file-thumbnail-placeholder .dashicons {
    font-size: 24px;
}

/* Title Column */
.col-title a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.col-title a:hover {
    text-decoration: underline;
}

.file-version {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-publish {
    background: #d1fae5;
    color: #065f46;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-draft {
    background: #fee2e2;
    color: #991b1b;
}

/* Tags */
.tags-more {
    color: #6b7280;
    font-size: 0.8rem;
}

.no-tags {
    color: #9ca3af;
    font-style: italic;
}

/* Stats */
.download-count,
.like-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: #6b7280;
}

.download-count .dashicons,
.like-count .dashicons {
    font-size: 16px;
}

/* Date */
.file-date {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Actions */
.file-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.action-button:hover {
    background: #e5e7eb;
    color: #374151;
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-view:hover {
    color: #0073aa;
    background: #dbeafe;
}

.action-edit:hover {
    color: #059669;
    background: #d1fae5;
}

.action-pending {
    color: #f59e0b;
    cursor: default;
}

.action-pending:hover {
    background: #fef3c7;
}

.action-delete {
    color: #dc2626;
}

.action-delete:hover {
    color: #fff;
    background: #dc2626;
}

.action-delete:disabled {
    background: #fee2e2;
    color: #dc2626;
}

.action-update {
    color: #10b981;
}

.action-update:hover {
    color: #fff;
    background: #10b981;
}


.col-author {
    width: 120px;
}

.files-filtered {
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
}

/* Spin animation for loading state */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin-animation {
    animation: spin 1s linear infinite;
}

/* No Files State */
.filehub-no-files {
    text-align: center;
    padding: 4rem 2rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.filehub-no-files p {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Pagination */
.filehub-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.filehub-pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    color: #0073aa;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.filehub-pagination .page-numbers:hover,
.filehub-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Notice */
.filehub-notice {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.filehub-notice-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.filehub-notice a {
    color: #0073aa;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .filehub-files-table {
        font-size: 0.8rem;
    }
    
    .filehub-files-table th,
    .filehub-files-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .col-tags {
        width: 120px;
    }
}

@media (max-width: 768px) {
    .filehub-my-files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filehub-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        min-width: 100%;
    }
    
    /* Hide less important columns on mobile */
    .col-category,
    .col-tags,
    .col-downloads {
        display: none;
    }
    
    .col-title {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .filehub-my-files-container {
        padding: 0 0.5rem;
    }
    
    .filehub-filters {
        padding: 1rem;
    }
    
    .filehub-files-table th,
    .filehub-files-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .file-thumbnail,
    .file-thumbnail-placeholder {
        width: 40px;
        height: 40px;
    }
    
    .file-thumbnail-placeholder .dashicons {
        font-size: 18px;
    }
    
    /* Hide more columns on very small screens */
    .col-likes,
    .col-date {
        display: none;
    }
}
