/* ============================================
   Parent Files - Shared Styles
   ============================================ */

/* Admin Styles */
.parent-files-admin .search-box-wrapper {
    margin-bottom: 20px;
}

.parent-files-admin #parent-search {
    width: 300px;
    padding: 8px 12px;
}

.parent-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.parent-folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.parent-folder:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.parent-folder .folder-icon {
    font-size: 48px;
    color: #f0c14b;
    margin-bottom: 10px;
}

.parent-folder .folder-name {
    font-weight: 600;
    text-align: center;
    margin-bottom: 5px;
    word-break: break-word;
}

.parent-folder .folder-meta {
    font-size: 12px;
    color: #666;
}

.parent-files-admin .card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.parent-files-admin .card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.parent-files-admin .no-files-message {
    color: #666;
    font-style: italic;
}

/* Admin file table */
.parent-files-admin #admin-files-table {
    margin-top: 15px;
    width: 100%;
}

.parent-files-admin .files-section,
.parent-files-admin .upload-section {
    max-width: 100%;
    box-sizing: border-box;
}

.parent-files-admin .file-actions .button {
    margin-right: 5px;
}

/* Ensure wrap uses full width */
.parent-files-admin.wrap {
    max-width: 100%;
    margin-right: 20px;
}

/* ============================================
   Frontend Styles (My Account)
   ============================================ */

.parent-files-frontend {
    max-width: 800px;
}

.parent-files-frontend h2 {
    margin-bottom: 20px;
}

.parent-files-frontend h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* Upload area */
.pf-upload-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.pf-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #fff;
    transition: all 0.2s ease;
}

.pf-upload-area:hover,
.pf-upload-area.drag-over {
    border-color: #2271b1;
    background: #f0f7fc;
}

.pf-upload-area .dashicons {
    font-size: 48px;
    color: #999;
    width: 48px;
    height: 48px;
}

.pf-upload-area p {
    margin: 10px 0;
    color: #666;
}

.pf-file-input {
    display: none;
}

.pf-upload-area label.button {
    cursor: pointer;
}

#pf-upload-preview {
    margin-top: 15px;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#pf-preview-filename {
    flex: 1;
    font-weight: 500;
}

.pf-file-types {
    margin-top: 10px;
    color: #666;
}

/* Files section */
.pf-files-section {
    margin-top: 20px;
}

#pf-files-table {
    width: 100%;
}

#pf-files-table th,
#pf-files-table td {
    padding: 12px;
    text-align: left;
}

#pf-files-table th {
    background: #f8f9fa;
    font-weight: 600;
}

#pf-files-table td {
    border-bottom: 1px solid #eee;
}

#pf-files-table .file-name {
    font-weight: 500;
}

#pf-files-table .file-actions {
    white-space: nowrap;
}

#pf-files-table .file-actions .button {
    margin-right: 5px;
    padding: 5px 10px;
    font-size: 13px;
}

#pf-files-table .delete-file {
    color: #666;
    border-color: #ccc;
}

#pf-files-table .delete-file:hover {
    background: #666;
    border-color: #666;
    color: #fff;
}

#pf-no-files {
    color: #666;
    font-style: italic;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 4px;
}

#pf-files-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Responsive */
@media (max-width: 600px) {
    .parent-folders-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .parent-folder {
        padding: 15px;
    }

    .parent-folder .folder-icon {
        font-size: 36px;
    }

    #pf-files-table th:nth-child(2),
    #pf-files-table td:nth-child(2),
    #pf-files-table th:nth-child(3),
    #pf-files-table td:nth-child(3) {
        display: none;
    }

    #pf-upload-preview {
        flex-wrap: wrap;
    }
}

/* Upload progress indicator */
.pf-uploading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.pf-uploading::after {
    content: "Uploading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
}
