/* WPUF User Tabs Block - Styles */

/* WordPress Theme Color Integration */
/* Use currentColor to inherit from the active WordPress theme */

/* Current color utility classes for theme integration */
.wpuf-border-current {
    border-color: currentColor !important;
}

.wpuf-text-current {
    color: currentColor !important;
}

.wpuf-outline-current {
    outline-color: currentColor !important;
}

/* Ensure tabs inherit theme colors properly */
.wpuf-user-tabs nav a,
.wpuf-user-tabs nav button {
    color: inherit;
}

.wpuf-user-tabs nav a.wpuf-border-current,
.wpuf-user-tabs nav button.wpuf-border-current {
    border-color: currentColor;
}

.wpuf-user-tabs nav a.wpuf-text-current,
.wpuf-user-tabs nav button.wpuf-text-current {
    color: currentColor;
}

/* Theme color inheritance for active tabs */
.wpuf-user-tabs .wpuf-border-current {
    border-color: currentColor !important;
}

.wpuf-user-tabs .wpuf-text-current {
    color: currentColor !important;
}

/* Ensure proper contrast and visibility */
.wpuf-user-tabs nav a:not(.wpuf-text-current),
.wpuf-user-tabs nav button:not(.wpuf-text-current) {
    color: #6b7280; /* Fallback gray for inactive tabs */
}

.wpuf-user-tabs nav a:not(.wpuf-text-current):hover,
.wpuf-user-tabs nav button:not(.wpuf-text-current):hover {
    color: #374151; /* Darker gray on hover for inactive tabs */
}

/* Focus states for accessibility */
.wpuf-user-tabs nav a:focus,
.wpuf-user-tabs nav button:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Tab content visibility - default state */
.wpuf-tab-content {
    display: none;
}

/* Active tab content */
.wpuf-tab-content.wpuf-tab-active {
    display: block !important;
}

/* Inactive tab content */
.wpuf-tab-content.wpuf-tab-inactive {
    display: none !important;
}

/* Editor-specific tab content visibility */
.editor-styles-wrapper .wpuf-tab-content {
    display: none;
}

.editor-styles-wrapper .wpuf-tab-content.wpuf-tab-active {
    display: block !important;
}

.editor-styles-wrapper .wpuf-tab-content.wpuf-tab-inactive {
    display: none !important;
}

/* Ensure tab content area is always visible in editor */
.editor-styles-wrapper .wpuf-tab-content-area {
    display: block !important;
}

/* Prevent nested User Tabs from interfering */
.wpuf-user-tabs .wpuf-user-tabs {
    pointer-events: none;
}

.wpuf-user-tabs .wpuf-user-tabs .wpuf-tab-content-area {
    display: none;
}

/* Loading state */
.wpuf-tab-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

/* Empty state */
.wpuf-tab-empty {
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Tab placeholder styling */
.wpuf-tab-placeholder {
    padding: 2rem;
    text-align: center;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.wpuf-tab-placeholder p {
    margin: 0;
    color: #6b7280;
    font-style: italic;
}

/* Tab preview in editor */
.wpuf-tab-preview {
    padding: 1rem;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.wpuf-tab-note {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* Fixed Tab Content Styles */
.wpuf-posts-tab-content,
.wpuf-comments-tab-content,
.wpuf-files-tab-content,
.wpuf-activity-tab-content {
    padding: 1rem 0;
}

/* Posts tab content */
.wpuf-post-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.wpuf-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.wpuf-post-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.wpuf-post-title a {
    color: #1f2937;
    text-decoration: none;
}

.wpuf-post-title a:hover {
    color: #3b82f6;
}

.wpuf-post-excerpt {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.wpuf-post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Comments tab content */
.wpuf-comment-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.wpuf-comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.wpuf-comment-text {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.wpuf-comment-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.wpuf-comment-post a {
    color: #3b82f6;
    text-decoration: none;
}

.wpuf-comment-post a:hover {
    text-decoration: underline;
}

/* Files tab content */
.wpuf-files-tab-content {
    padding: 1rem 0;
}

/* Activity tab content */
.wpuf-activity-tab-content {
    padding: 1rem 0;
}

/* Files tab specific styles */
.wpuf-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.wpuf-file-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.wpuf-file-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpuf-file-icon {
    margin-bottom: 0.75rem;
}

.wpuf-file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.wpuf-file-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.wpuf-file-size {
    color: #6b7280;
}

.wpuf-file-download {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.wpuf-file-download:hover {
    text-decoration: underline;
}

/* Tab Management Interface Styles */
.wpuf-tab-management {
    margin: 1rem 0;
}

.wpuf-tab-item {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: move;
    transition: all 0.2s ease;
}

.wpuf-tab-item:hover {
    border-color: #9ca3af;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Disabled tab styling */
.wpuf-tab-item.wpuf-tab-disabled {
    background: #f9fafb;
    border-color: #e5e7eb;
    opacity: 0.7;
}

.wpuf-tab-item.wpuf-tab-disabled:hover {
    border-color: #d1d5db;
    box-shadow: none;
}

.wpuf-tab-item.wpuf-tab-disabled .wpuf-tab-label {
    color: #9ca3af;
}

.wpuf-tab-item.wpuf-tab-disabled .wpuf-tab-drag-handle {
    color: #d1d5db;
}

.wpuf-tab-item.wpuf-dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
}

.wpuf-tab-item.wpuf-editing {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wpuf-tab-item-content {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    gap: 0.75rem;
}

.wpuf-tab-drag-handle {
    color: #9ca3af;
    cursor: move;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease;
}

.wpuf-tab-drag-handle:hover {
    color: #6b7280;
    background: #f3f4f6;
}

.wpuf-tab-drag-handle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.wpuf-tab-info {
    flex: 1;
    min-width: 0;
}

.wpuf-tab-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    color: #374151;
}

.wpuf-tab-label button {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wpuf-tab-item:hover .wpuf-tab-label button {
    opacity: 1;
}

.wpuf-tab-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wpuf-tab-edit-form .components-text-control__input {
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
}

.wpuf-tab-edit-actions {
    display: flex;
    gap: 0.25rem;
}

.wpuf-tab-toggle {
    flex-shrink: 0;
}

.wpuf-tab-summary {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.wpuf-tab-summary p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Ensure proper tab width distribution */
.wpuf-w-1\/2 {
    width: 50%;
}

.wpuf-w-1\/3 {
    width: 33.333333%;
}

.wpuf-w-1\/4 {
    width: 25%;
}

.wpuf-w-1\/5 {
    width: 20%;
}



/* Drag and drop visual feedback */
.wpuf-tab-item.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

/* Tab title styling */
.wpuf-tab-title {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

/* User Tabs navigation anchors: remove underline styles */
.wpuf-user-tabs nav a {
    text-decoration: none;
}

.wpuf-user-tabs nav a:hover,
.wpuf-user-tabs nav a:active {
    text-decoration: none;
}

/* Error and empty states */
.wpuf-tab-error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .wpuf-files-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }

    .wpuf-file-item {
        padding: 0.75rem;
    }

    .wpuf-tab-item-content {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .wpuf-post-meta,
    .wpuf-comment-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}
