/**
 * WPLake Members Area - Public Styles
 * 
 * Modern, professional design for member dashboard
 */

:root {
    --wplake-primary: #1e40af;
    --wplake-primary-dark: #1e3a8a;
    --wplake-primary-light: #3b82f6;
    --wplake-secondary: #64748b;
    --wplake-success: #059669;
    --wplake-warning: #d97706;
    --wplake-danger: #dc2626;
    --wplake-bg: #f8fafc;
    --wplake-bg-card: #ffffff;
    --wplake-border: #e2e8f0;
    --wplake-text: #1e293b;
    --wplake-text-muted: #64748b;
    --wplake-radius: 12px;
    --wplake-radius-sm: 8px;
    --wplake-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --wplake-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --wplake-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Reset */
.wplake-ma-dashboard,
.wplake-ma-auth-container,
.wplake-ma-form-wrapper,
.wplake-ma-status-page {
    font-family: var(--wplake-font);
    color: var(--wplake-text);
    line-height: 1.6;
    box-sizing: border-box;
}

.wplake-ma-dashboard *,
.wplake-ma-auth-container *,
.wplake-ma-form-wrapper *,
.wplake-ma-status-page * {
    box-sizing: inherit;
}

/* Buttons */
.wplake-ma-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--wplake-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wplake-ma-btn-primary {
    background: var(--wplake-primary);
    color: #fff;
}

.wplake-ma-btn-primary:hover {
    background: var(--wplake-primary-dark);
    color: #fff;
}

.wplake-ma-btn-secondary {
    background: var(--wplake-bg);
    color: var(--wplake-text);
    border: 1px solid var(--wplake-border);
}

.wplake-ma-btn-secondary:hover {
    background: var(--wplake-border);
    color: var(--wplake-text);
}

.wplake-ma-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wplake-ma-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Auth Container */
.wplake-ma-auth-container {
    max-width: 440px;
    margin: 40px auto;
    background: var(--wplake-bg-card);
    border-radius: var(--wplake-radius);
    box-shadow: var(--wplake-shadow-lg);
    overflow: hidden;
}

.wplake-ma-auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--wplake-border);
}

.wplake-ma-auth-tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--wplake-text-muted);
    font-weight: 500;
    background: var(--wplake-bg);
    transition: all 0.2s;
}

.wplake-ma-auth-tab:hover {
    color: var(--wplake-primary);
}

.wplake-ma-auth-tab.active {
    background: var(--wplake-bg-card);
    color: var(--wplake-primary);
    border-bottom: 2px solid var(--wplake-primary);
    margin-bottom: -1px;
}

.wplake-ma-auth-content {
    padding: 0;
}

/* Form Wrapper */
.wplake-ma-form-wrapper {
    padding: 32px;
}

.wplake-ma-form-header {
    text-align: center;
    margin-bottom: 24px;
}

.wplake-ma-form-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--wplake-text);
}

.wplake-ma-form-header p {
    margin: 0;
    color: var(--wplake-text-muted);
}

/* Form Elements */
.wplake-ma-form-group {
    margin-bottom: 20px;
}

.wplake-ma-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wplake-ma-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wplake-text);
}

.wplake-ma-form-group label .required {
    color: var(--wplake-danger);
}

.wplake-ma-form-group input[type="text"],
.wplake-ma-form-group input[type="email"],
.wplake-ma-form-group input[type="password"],
.wplake-ma-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--wplake-border);
    border-radius: var(--wplake-radius-sm);
    font-size: 14px;
    transition: all 0.2s;
}

.wplake-ma-form-group input:focus,
.wplake-ma-form-group textarea:focus {
    outline: none;
    border-color: var(--wplake-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.wplake-ma-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--wplake-text-muted);
}

/* Form Inline */
.wplake-ma-form-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wplake-ma-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.wplake-ma-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--wplake-primary);
}

.wplake-ma-forgot-password {
    font-size: 14px;
    color: var(--wplake-primary);
    text-decoration: none;
}

.wplake-ma-forgot-password:hover {
    text-decoration: underline;
}

/* Form Message */
.wplake-ma-form-message {
    padding: 12px 16px;
    border-radius: var(--wplake-radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.wplake-ma-form-message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--wplake-danger);
}

.wplake-ma-form-message.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: var(--wplake-success);
}

/* Form Footer */
.wplake-ma-form-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--wplake-border);
    text-align: center;
}

.wplake-ma-form-footer p {
    margin: 0;
    color: var(--wplake-text-muted);
    font-size: 14px;
}

.wplake-ma-form-footer a {
    color: var(--wplake-primary);
    text-decoration: none;
    font-weight: 500;
}

.wplake-ma-form-footer a:hover {
    text-decoration: underline;
}

.wplake-ma-approval-notice {
    background: #fefce8;
    border: 1px solid #fef08a;
    padding: 12px;
    border-radius: var(--wplake-radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--wplake-warning);
    margin-bottom: 16px !important;
}

.wplake-ma-approval-notice .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Dashboard */
.wplake-ma-dashboard {
    background: var(--wplake-bg);
    border-radius: var(--wplake-radius);
    padding: 24px;
}

.wplake-ma-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--wplake-border);
}

.wplake-ma-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wplake-ma-user-info img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.wplake-ma-user-details {
    display: flex;
    flex-direction: column;
}

.wplake-ma-welcome {
    font-size: 12px;
    color: var(--wplake-text-muted);
}

.wplake-ma-username {
    font-size: 16px;
    font-weight: 600;
    color: var(--wplake-text);
}

/* Breadcrumb */
.wplake-ma-breadcrumb {
    background: var(--wplake-bg-card);
    padding: 12px 16px;
    border-radius: var(--wplake-radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.wplake-ma-breadcrumb a {
    color: var(--wplake-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wplake-ma-breadcrumb a:hover {
    text-decoration: underline;
}

.wplake-ma-breadcrumb .separator {
    color: var(--wplake-text-muted);
    margin: 0 4px;
}

.wplake-ma-breadcrumb .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Toolbar */
.wplake-ma-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* File Browser */
.wplake-ma-file-browser {
    background: var(--wplake-bg-card);
    border-radius: var(--wplake-radius);
    box-shadow: var(--wplake-shadow);
    min-height: 300px;
}

.wplake-ma-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--wplake-text-muted);
}

.wplake-ma-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--wplake-border);
    margin-bottom: 16px;
}

/* File Grid */
.wplake-ma-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
}

.wplake-ma-file-item {
    background: var(--wplake-bg);
    border: 1px solid var(--wplake-border);
    border-radius: var(--wplake-radius-sm);
    display: flex;
    align-items: center;
    padding: 16px;
    transition: all 0.2s;
    position: relative;
}

.wplake-ma-file-item:hover {
    border-color: var(--wplake-primary-light);
    box-shadow: var(--wplake-shadow);
}

.wplake-ma-file-link {
    display: flex;
    align-items: center;
    flex: 1;
    text-decoration: none;
    color: inherit;
    gap: 12px;
}

.wplake-ma-file-icon {
    width: 48px;
    height: 48px;
    background: var(--wplake-bg-card);
    border-radius: var(--wplake-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wplake-ma-folder .wplake-ma-file-icon {
    background: #fef3c7;
}

.wplake-ma-folder .wplake-ma-file-icon .dashicons {
    color: #d97706;
}

.wplake-ma-file .wplake-ma-file-icon .dashicons {
    color: var(--wplake-primary);
}

.wplake-ma-file-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.wplake-ma-file-info {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 60px);
}

.wplake-ma-file-name {
    display: block;
    font-weight: 500;
    color: var(--wplake-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    max-width: 100%;
}

/* Tooltip for long file names */
.wplake-ma-file-name[title] {
    cursor: help;
}

.wplake-ma-file-item:hover .wplake-ma-file-name {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
}

.wplake-ma-file-meta {
    display: block;
    font-size: 12px;
    color: var(--wplake-text-muted);
}

.wplake-ma-file-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.wplake-ma-file-item:hover .wplake-ma-file-actions {
    opacity: 1;
}

.wplake-ma-file-actions a,
.wplake-ma-file-actions button {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--wplake-bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--wplake-text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.wplake-ma-file-actions a:hover,
.wplake-ma-file-actions button:hover {
    background: var(--wplake-primary);
    color: #fff;
}

.wplake-ma-file-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Modal */
.wplake-ma-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wplake-ma-modal-content {
    background: var(--wplake-bg-card);
    border-radius: var(--wplake-radius);
    padding: 24px;
    max-width: 480px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.wplake-ma-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: var(--wplake-text-muted);
    line-height: 1;
}

.wplake-ma-modal-close:hover {
    color: var(--wplake-text);
}

.wplake-ma-modal h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
}

.wplake-ma-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Upload Area */
.wplake-ma-upload-area {
    border: 2px dashed var(--wplake-border);
    border-radius: var(--wplake-radius-sm);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.wplake-ma-upload-area:hover,
.wplake-ma-upload-area.dragover {
    border-color: var(--wplake-primary);
    background: rgba(30, 64, 175, 0.05);
}

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

.wplake-ma-upload-area .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--wplake-primary);
    margin-bottom: 12px;
}

.wplake-ma-upload-area p {
    margin: 0;
    color: var(--wplake-text-muted);
}

.wplake-ma-upload-area .wplake-ma-selected-file {
    color: var(--wplake-success);
    font-weight: 500;
    margin-top: 8px;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wplake-ma-upload-area .wplake-ma-selected-file .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--wplake-success);
}

/* Progress Bar */
.wplake-ma-progress-bar {
    background: var(--wplake-border);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.wplake-ma-progress-fill {
    background: var(--wplake-primary);
    height: 100%;
    width: 0;
    transition: width 0.3s;
}

.wplake-ma-progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    color: var(--wplake-text-muted);
}

/* Status Pages */
.wplake-ma-status-page {
    text-align: center;
    padding: 60px 20px;
    background: var(--wplake-bg-card);
    border-radius: var(--wplake-radius);
    box-shadow: var(--wplake-shadow);
    max-width: 480px;
    margin: 40px auto;
}

.wplake-ma-status-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.wplake-ma-status-icon .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
}

.wplake-ma-status-icon.pending {
    background: #fef3c7;
    color: var(--wplake-warning);
}

.wplake-ma-status-icon.rejected {
    background: #fee2e2;
    color: var(--wplake-danger);
}

.wplake-ma-status-icon.no-access {
    background: #e2e8f0;
    color: var(--wplake-secondary);
}

.wplake-ma-status-page h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
}

.wplake-ma-status-page p {
    color: var(--wplake-text-muted);
    margin: 0 0 16px 0;
}

/* Share Styles */
.wplake-ma-share-btn {
    background: none;
    border: none;
    color: var(--wplake-primary);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

.wplake-ma-share-btn:hover {
    color: var(--wplake-primary-dark);
}

.wplake-ma-shared-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--wplake-primary);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wplake-ma-shared-badge .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.wplake-ma-file-icon {
    position: relative;
}

.wplake-ma-shared-item {
    border-left: 3px solid var(--wplake-primary);
}

.wplake-ma-share-list {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--wplake-border);
}

.wplake-ma-share-list h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--wplake-text-muted);
}

#wplake-ma-shares-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#wplake-ma-shares-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--wplake-bg-light);
    border-radius: var(--wplake-radius-sm);
    margin-bottom: 8px;
}

#wplake-ma-shares-list li.wplake-ma-loading,
#wplake-ma-shares-list li.wplake-ma-empty {
    justify-content: center;
    color: var(--wplake-text-muted);
    font-style: italic;
}

.wplake-ma-share-user {
    font-weight: 500;
}

.wplake-ma-unshare-btn {
    background: none;
    border: none;
    color: var(--wplake-danger);
    cursor: pointer;
    padding: 2px;
}

.wplake-ma-unshare-btn:hover {
    color: #b91c1c;
}

.wplake-ma-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid var(--wplake-border);
    border-radius: var(--wplake-radius-sm);
    background: var(--wplake-bg-card);
    color: var(--wplake-text);
}

.wplake-ma-select:focus {
    outline: none;
    border-color: var(--wplake-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .wplake-ma-form-row {
        grid-template-columns: 1fr;
    }
    
    .wplake-ma-dashboard-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .wplake-ma-user-info {
        flex-direction: column;
    }
    
    .wplake-ma-file-grid {
        grid-template-columns: 1fr;
    }
    
    .wplake-ma-toolbar {
        flex-direction: column;
    }
    
    .wplake-ma-toolbar .wplake-ma-btn {
        justify-content: center;
    }
    
    .wplake-ma-file-actions {
        opacity: 1;
    }
}
