/* Modern Public Styles for MemberPress File Manager */

:root {
    --mpfm-primary: #2563eb;
    --mpfm-primary-hover: #1d4ed8;
    --mpfm-secondary: #64748b;
    --mpfm-success: #10b981;
    --mpfm-warning: #f59e0b;
    --mpfm-danger: #ef4444;
    --mpfm-light: #f8fafc;
    --mpfm-dark: #1e293b;
    --mpfm-border: #e2e8f0;
    --mpfm-text: #334155;
    --mpfm-text-light: #64748b;
    --mpfm-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --mpfm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --mpfm-radius: 8px;
    --mpfm-radius-sm: 4px;
}

/* File List Styles */
.mpfm-file-list {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: var(--mpfm-radius);
    box-shadow: var(--mpfm-shadow);
    border: 1px solid var(--mpfm-border);
}

.mpfm-file-list h3 {
    margin: 0 0 1.5rem 0;
    color: var(--mpfm-dark);
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid var(--mpfm-primary);
    padding-bottom: 0.5rem;
}

/* File Table */
.mpfm-file-table-header {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    font-weight: 600;
    background: var(--mpfm-light);
    padding: 1rem;
    border-radius: var(--mpfm-radius-sm) var(--mpfm-radius-sm) 0 0;
    border: 1px solid var(--mpfm-border);
    color: var(--mpfm-dark);
}

.mpfm-file-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 1rem;
    border: 1px solid var(--mpfm-border);
    border-top: none;
    transition: background-color 0.2s ease;
}

.mpfm-file-row:hover {
    background-color: #f8fafc;
}

.mpfm-file-row:last-child {
    border-radius: 0 0 var(--mpfm-radius-sm) var(--mpfm-radius-sm);
}

.mpfm-file-column {
    padding: 0.5rem;
    word-wrap: break-word;
    color: var(--mpfm-text);
    display: flex;
    align-items: center;
}

.mpfm-actions {
    justify-content: flex-end;
}

.mpfm-no-files {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--mpfm-text-light);
    padding: 2rem;
    font-style: italic;
}

/* Action Links */
.mpfm-action-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
    border-radius: var(--mpfm-radius-sm);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.mpfm-download-link {
    background-color: var(--mpfm-success);
    color: white;
    border-color: var(--mpfm-success);
}

.mpfm-download-link:hover {
    background-color: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.mpfm-delete-link {
    background-color: var(--mpfm-danger);
    color: white;
    border-color: var(--mpfm-danger);
}

.mpfm-delete-link:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.mpfm-view-link {
    background-color: var(--mpfm-primary);
    color: white;
    border-color: var(--mpfm-primary);
}

.mpfm-view-link:hover {
    background-color: var(--mpfm-primary-hover);
    border-color: var(--mpfm-primary-hover);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Upload Form Styles */
.mpfm-upload-form {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border: 1px solid var(--mpfm-border);
    border-radius: var(--mpfm-radius);
    box-shadow: var(--mpfm-shadow);
}

.mpfm-upload-form h3 {
    margin: 0 0 0.5rem 0;
    color: var(--mpfm-primary);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.mpfm-upload-form h4 {
    margin: 0 0 1.5rem 0;
    color: var(--mpfm-text);
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--mpfm-border);
}

.mpfm-form-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mpfm-form-group {
    display: flex;
    flex-direction: column;
}

.mpfm-form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--mpfm-dark);
    font-size: 0.875rem;
}

.mpfm-form-group input,
.mpfm-form-group textarea,
.mpfm-form-group select {
    padding: 0.75rem;
    border: 1px solid var(--mpfm-border);
    border-radius: var(--mpfm-radius-sm);
    width: 100%;
    box-sizing: border-box;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mpfm-form-group input:focus,
.mpfm-form-group textarea:focus,
.mpfm-form-group select:focus {
    outline: none;
    border-color: var(--mpfm-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Upload Area */
.mpfm-upload-area {
    border: 2px dashed var(--mpfm-border);
    padding: 2rem;
    text-align: center;
    background: var(--mpfm-light);
    border-radius: var(--mpfm-radius-sm);
    transition: border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    position: relative;
}

.mpfm-upload-area:hover {
    border-color: var(--mpfm-primary);
    background-color: #f0f9ff;
}

.mpfm-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.mpfm-upload-icon {
    font-size: 2rem;
    color: var(--mpfm-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.mpfm-upload-area p {
    margin: 0;
    color: var(--mpfm-text);
    font-weight: 500;
}

/* Links Group */
.mpfm-links-group {
    flex-direction: row !important;
    gap: 1rem;
}

.mpfm-links-input {
    flex: 1;
}

/* Button */
.mpfm-button {
    background: var(--mpfm-primary);
    color: white;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--mpfm-radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 0.5rem;
}

.mpfm-button:hover {
    background: var(--mpfm-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--mpfm-shadow);
}

/* Progress Bar */
.mpfm-upload-progress {
    width: 100%;
    height: 8px;
    background: var(--mpfm-light);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid var(--mpfm-border);
}

.mpfm-upload-progress div {
    height: 100%;
    background: linear-gradient(90deg, var(--mpfm-primary), var(--mpfm-success));
    width: 0;
    transition: width 0.3s ease;
    border-radius: 9999px;
}

/* Case Progress */
.mpfm-progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--mpfm-light);
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid var(--mpfm-border);
}

.mpfm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--mpfm-primary), var(--mpfm-success));
    transition: width 0.3s ease;
    border-radius: 9999px;
}

/* Case Sections */
.mpfm-case-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid var(--mpfm-border);
    border-radius: var(--mpfm-radius);
    box-shadow: var(--mpfm-shadow);
}

.mpfm-case-section h4 {
    margin: 0 0 1rem 0;
    color: var(--mpfm-primary);
    font-size: 1.125rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--mpfm-border);
}

.mpfm-case-section h5 {
    margin: 1.5rem 0 1rem 0;
    color: var(--mpfm-dark);
    font-size: 1rem;
    font-weight: 600;
}

.mpfm-case-details {
    margin-top: 1rem;
}

.mpfm-case-details p {
    margin: 0.5rem 0;
    color: var(--mpfm-text);
    line-height: 1.5;
}

.mpfm-case-details strong {
    color: var(--mpfm-dark);
    font-weight: 500;
}

/* Updates List */
.mpfm-updates-list {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--mpfm-primary);
}

.mpfm-update-row {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--mpfm-light);
    border-radius: var(--mpfm-radius-sm);
    border: 1px solid var(--mpfm-border);
}

.mpfm-update-row:last-child {
    margin-bottom: 0;
}

/* Yearly Allowance Table */
.mpfm-yearly-allowance {
    margin-top: 1rem;
}

.mpfm-yearly-allowance label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--mpfm-dark);
}

.mpfm-yearly-allowance table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--mpfm-border);
    border-radius: var(--mpfm-radius);
    overflow: hidden;
    background: white;
}

.mpfm-yearly-allowance th,
.mpfm-yearly-allowance td {
    border: 1px solid var(--mpfm-border);
    padding: 0.75rem;
    text-align: center;
}

.mpfm-yearly-allowance th {
    background: var(--mpfm-light);
    color: var(--mpfm-dark);
    font-weight: 600;
    font-size: 0.875rem;
}

.mpfm-yearly-allowance td input {
    border: 1px solid var(--mpfm-border);
    border-radius: var(--mpfm-radius-sm);
    padding: 0.5rem;
    width: 100%;
    font-size: 0.875rem;
}

.mpfm-yearly-allowance tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Links */
.mpfm-link {
    color: var(--mpfm-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.mpfm-link:hover {
    color: var(--mpfm-primary-hover);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mpfm-file-table-header,
    .mpfm-file-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .mpfm-file-column {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid var(--mpfm-border);
    }
    
    .mpfm-file-column::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--mpfm-dark);
        margin-right: 1rem;
        min-width: 100px;
    }
    
    .mpfm-file-table-header .mpfm-file-column::before {
        display: none;
    }
    
    .mpfm-actions {
        justify-content: flex-end;
    }
    
    .mpfm-upload-form {
        margin: 1rem;
        padding: 1rem;
    }
    
    .mpfm-links-group {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    .mpfm-yearly-allowance table {
        font-size: 0.75rem;
    }
    
    .mpfm-yearly-allowance th,
    .mpfm-yearly-allowance td {
        padding: 0.5rem 0.25rem;
    }
}

/* Select2 Styling */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--mpfm-border) !important;
    border-radius: var(--mpfm-radius-sm) !important;
    height: auto !important;
    padding: 0.5rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--mpfm-text) !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single:focus {
    border-color: var(--mpfm-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

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

.mpfm-upload-form,
.mpfm-case-section,
.mpfm-file-list {
    animation: fadeIn 0.3s ease-out;
}

/* Loading States */
.mpfm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mpfm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--mpfm-border);
    border-top: 2px solid var(--mpfm-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

