/**
 * WPDM Dashboard - Slack-Style Design
 * Modern, contained frame with dark sidebar
 */

/* ==========================================================================
   1. Design Tokens
   ========================================================================== */

.wpdm-dashboard {
    /* Sidebar Colors - Uses --color-primary from theme */
    --sidebar-bg: var(--color-primary, #0073aa);
    --sidebar-border: rgba(255, 255, 255, 0.15);
    --sidebar-text: rgba(255, 255, 255, 0.9);
    --sidebar-text-muted: rgba(255, 255, 255, 0.65);
    --sidebar-hover: rgba(255, 255, 255, 0.12);
    --sidebar-active: rgba(255, 255, 255, 0.2);
    --sidebar-active-border: #fff;

    /* Main Content Colors */
    --main-bg: #f8fafc;
    --content-bg: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Accent Colors */
    --accent: var(--color-primary);
    --accent-hover: var(--color-primary-hover);
    --accent-light: rgba(var(--color-primary-rgb), 0.1);
    --accent-rgb: var(--color-primary-rgb);

    /* Status Colors */
    --success: var(--color-success);
    --success-light:  rgba(var(--color-success-rgb), 0.1);
    --warning: var(--color-warning);
    --warning-light: rgba(var(--color-warning-rgb), 0.1);
    --danger: var(--color-danger);
    --danger-light: rgba(var(--color-danger-rgb), 0.1);
    --info: var(--color-info);
    --info-light: rgba(var(--color-info-rgb), 0.1);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(0, 115, 170, 0.12);

    /* Spacing */
    --sidebar-width: 260px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}

/* ==========================================================================
   2. Base & Reset
   ========================================================================== */

.wpdm-dashboard {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wpdm-dashboard *,
.wpdm-dashboard *::before,
.wpdm-dashboard *::after {
    box-sizing: border-box;
}

.wpdm-dashboard ul,
.wpdm-dashboard ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wpdm-dashboard li::before,
.wpdm-dashboard li::marker {
    display: none;
    content: none;
}

/* ==========================================================================
   3. Dashboard Frame - Contained Layout
   ========================================================================== */

.wpdm-dashboard-frame {
    display: flex;
    min-height: 500px;
    background: var(--content-bg);
    border-radius: var(--radius-xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   4. Sidebar
   ========================================================================== */

.wpdm-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, color-mix(in srgb, var(--sidebar-bg) 85%, #000) 100%);
    border-right: 1px solid var(--sidebar-border);
    position: relative;
}

/* SVG pattern overlay */
.wpdm-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.8;
}

/* Sidebar Header - User Profile */
.wpdm-sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.wpdm-sidebar-header .wpdm-user-avatar {
    width: 52px;
    height: 52px;
}

.wpdm-sidebar-header .wpdm-user-avatar img {
    border-radius: var(--radius-md);
    border: 3px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wpdm-sidebar-header .wpdm-user-name {
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wpdm-sidebar-header .wpdm-user-role {
    font-size: 12px;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 2px;
}

/* Navigation */
.wpdm-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    position: relative;
    z-index: 1;
}

.wpdm-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.wpdm-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.wpdm-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.wpdm-nav-group {
    margin-bottom: 4px;
}

.wpdm-nav-group-title {
    padding: 18px 14px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5) !important;
}

.wpdm-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none !important;
    border-radius: var(--radius-sm);
    margin: 2px 0;
    transition: all var(--transition-fast);
    position: relative;
}

.wpdm-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
    text-decoration: none !important;
}

.wpdm-nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff !important;
    font-weight: 600;
}

.wpdm-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 55%;
    background: #fff;
    border-radius: 0 3px 3px 0;
}

.wpdm-nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.75) !important;
    transition: all var(--transition-fast);
}

.wpdm-nav-link:hover i,
.wpdm-nav-link.active i {
    color: #fff !important;
}

/* User Profile */
.wpdm-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpdm-user-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.wpdm-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
    margin: 0 !important;
}

.wpdm-user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid var(--sidebar-bg);
    border-radius: 50%;
}

.wpdm-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wpdm-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.wpdm-user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Sidebar Footer - Logout */
.wpdm-sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.wpdm-logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.wpdm-logout-link:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5 !important;
    text-decoration: none !important;
}

.wpdm-logout-link svg {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all var(--transition-fast);
}

.wpdm-logout-link:hover svg {
    color: #fca5a5 !important;
}

/* ==========================================================================
   5. Main Content
   ========================================================================== */

.wpdm-main {
    flex: 1;
    min-width: 0;
    background: var(--main-bg);
    overflow-y: auto;
}

.wpdm-main-inner {
    padding: 24px;
    min-height: 100%;
}

/* ==========================================================================
   6. Mobile Toggle
   ========================================================================== */

.wpdm-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.wpdm-mobile-toggle:hover {
    transform: scale(1.05);
}

/* Overlay */
.wpdm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.wpdm-overlay.visible {
    opacity: 1;
}

/* ==========================================================================
   7. Stats Grid
   ========================================================================== */

.wpdm-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .wpdm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .wpdm-stats-grid {
        grid-template-columns: 1fr;
    }
}

.wpdm-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--content-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.wpdm-stat-card:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.08);
}

.wpdm-stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.wpdm-stat-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.wpdm-stat-icon--success {
    background: var(--success-light);
}
.wpdm-stat-icon--success svg {
    color: var(--success);
}

.wpdm-stat-icon--warning {
    background: var(--warning-light);
}
.wpdm-stat-icon--warning svg {
    color: var(--warning);
}

.wpdm-stat-icon--info {
    background: var(--info-light);
}
.wpdm-stat-icon--info svg {
    color: var(--info);
}

.wpdm-stat-icon--danger {
    background: var(--danger-light);
}
.wpdm-stat-icon--danger svg {
    color: var(--danger);
}

.wpdm-stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wpdm-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.wpdm-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

/* ==========================================================================
   8. Cards
   ========================================================================== */

.wpdm-card {
    background: var(--content-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.wpdm-card + .wpdm-card {
    margin-top: 20px;
}

.wpdm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--border-color);
}

.wpdm-card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.wpdm-card-header h3 svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.wpdm-card-body {
    padding: 20px;
}

.wpdm-card-footer {
    padding: 14px 20px;
    background: var(--border-light);
    border-top: 1px solid var(--border-color);
}

.wpdm-card--action {
    padding: 16px 20px;
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   9. Tables
   ========================================================================== */

.wpdm-table-wrap {
    overflow-x: auto;
}

.wpdm-table-wrap .wpdm-table {
    margin: 0 !important;
}

.wpdm-table {
    width: 100%;
    border-collapse: collapse;
}

.wpdm-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--border-light);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.wpdm-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.wpdm-table tbody tr:last-child td {
    border-bottom: none;
}

.wpdm-table tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.02);
}

.wpdm-table-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.wpdm-table-link:hover {
    text-decoration: underline;
}

/* Responsive table */
.wpdm-hide-mobile {
    display: table-cell;
}

@media (max-width: 768px) {
    .wpdm-hide-mobile {
        display: none;
    }
}

/* ==========================================================================
   10. Forms
   ========================================================================== */

.wpdm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 640px) {
    .wpdm-form-grid {
        grid-template-columns: 1fr;
    }
}

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

.wpdm-form-group--full {
    grid-column: 1 / -1;
}

.wpdm-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.wpdm-input,
.wpdm-textarea,
.wpdm-select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.wpdm-input:focus,
.wpdm-textarea:focus,
.wpdm-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.wpdm-input::placeholder,
.wpdm-textarea::placeholder {
    color: var(--text-muted);
}

.wpdm-input--readonly {
    background: var(--border-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

.wpdm-textarea {
    resize: vertical;
    min-height: 100px;
}

.wpdm-required {
    color: var(--danger);
    margin-left: 2px;
}

.wpdm-help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 0;
}

/* ==========================================================================
   11. Buttons
   ========================================================================== */

.wpdm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.wpdm-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.wpdm-btn--primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
}

.wpdm-btn--primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #4338ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
    color: #fff;
}

.wpdm-btn--secondary {
    background: var(--content-bg);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.wpdm-btn--secondary:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.wpdm-btn--success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.wpdm-btn--success:hover {
    background: #059669;
    border-color: #059669;
}

.wpdm-btn--danger {
    background: var(--content-bg);
    color: var(--danger);
    border-color: var(--danger-light);
}

.wpdm-btn--danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
}

.wpdm-btn--sm {
    padding: 6px 12px;
    font-size: 13px;
}

.wpdm-btn--lg {
    padding: 14px 24px;
    font-size: 15px;
}

.wpdm-btn svg {
    width: 18px;
    height: 18px;
}

.wpdm-btn--sm svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   12. Badges
   ========================================================================== */

.wpdm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 100px;
    background: var(--border-light);
    color: var(--text-secondary);
}

.wpdm-badge--primary {
    background: var(--accent-light);
    color: var(--accent);
}

.wpdm-badge--success {
    background: var(--success-light);
    color: #059669;
}

.wpdm-badge--warning {
    background: var(--warning-light);
    color: #d97706;
}

.wpdm-badge--danger {
    background: var(--danger-light);
    color: var(--danger);
}

.wpdm-badge--info {
    background: var(--info-light);
    color: #0284c7;
}

/* ==========================================================================
   13. Alerts
   ========================================================================== */

.wpdm-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.wpdm-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.wpdm-alert--success {
    background: var(--success-light);
    color: #065f46;
}

.wpdm-alert--success svg {
    color: var(--success);
}

.wpdm-alert--warning {
    background: var(--warning-light);
    color: #92400e;
}

.wpdm-alert--warning svg {
    color: var(--warning);
}

.wpdm-alert--danger {
    background: var(--danger-light);
    color: #991b1b;
}

.wpdm-alert--danger svg {
    color: var(--danger);
}

.wpdm-alert--info {
    background: var(--info-light);
    color: #075985;
}

.wpdm-alert--info svg {
    color: var(--info);
}

/* ==========================================================================
   14. Empty State
   ========================================================================== */

.wpdm-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.wpdm-empty-state svg {
    width: 56px;
    height: 56px;
    color: var(--border-color);
    margin-bottom: 16px;
}

.wpdm-empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.wpdm-empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.wpdm-empty-state--compact {
    padding: 32px 20px;
}

.wpdm-empty-state--compact svg {
    width: 40px;
    height: 40px;
}

.wpdm-empty-state--compact h4 {
    font-size: 14px;
}

.wpdm-empty-state--compact p {
    font-size: 13px;
}

/* ==========================================================================
   15. Recommended Grid
   ========================================================================== */

.wpdm-recommended-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.wpdm-recommended-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--content-bg);
    transition: all var(--transition-base);
}

.wpdm-recommended-item:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.1);
    transform: translateY(-2px);
}

.wpdm-recommended-thumb {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--border-light);
}

.wpdm-recommended-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.wpdm-recommended-item:hover .wpdm-recommended-img {
    transform: scale(1.05);
}

.wpdm-recommended-title {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   16. Pagination
   ========================================================================== */

.wpdm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.wpdm-pagination a,
.wpdm-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.wpdm-pagination a:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.wpdm-pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.wpdm-pagination .prev,
.wpdm-pagination .next {
    padding: 0;
    min-width: 34px;
}

.wpdm-pagination .dots {
    border: none;
    background: transparent;
    color: var(--text-muted);
    pointer-events: none;
}

/* ==========================================================================
   17. Utility Classes
   ========================================================================== */

.wpdm-ip {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--border-light);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.wpdm-date {
    color: var(--text-muted);
    font-size: 13px;
}

.wpdm-price {
    font-weight: 600;
    color: var(--text-primary);
}

.wpdm-product-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wpdm-product-name {
    font-weight: 500;
    color: var(--text-primary);
}

.wpdm-file-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.wpdm-file-meta svg {
    width: 14px;
    height: 14px;
}

.wpdm-mobile-meta {
    display: none;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .wpdm-mobile-meta {
        display: block;
    }
}

/* Spin Animation */
@keyframes wpdm-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* ==========================================================================
   18. Avatar Upload
   ========================================================================== */

.wpdm-avatar-upload {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.wpdm-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--content-bg);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.wpdm-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wpdm-avatar-preview svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
}

.wpdm-avatar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

/* ==========================================================================
   19. Orders List
   ========================================================================== */

.wpdm-orders-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wpdm-order-row {
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.wpdm-order-row:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    box-shadow: var(--shadow-sm);
}

.wpdm-order-row__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    background: var(--border-light);
}

.wpdm-order-row__id {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpdm-order-row__id-label {
    font-size: 13px;
    color: var(--text-muted);
}

.wpdm-order-row__id-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.wpdm-order-row__price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.wpdm-order-row__details {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
}

.wpdm-order-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.wpdm-order-row__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.wpdm-order-row__meta-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.wpdm-order-row__meta-value {
    color: var(--text-secondary);
    font-weight: 500;
}

.wpdm-order-status--active {
    color: var(--success);
}

.wpdm-order-status--expired {
    color: var(--danger);
}

.wpdm-order-status--pending {
    color: var(--warning);
}

.wpdm-order-row__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpdm-order-row__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    transition: all var(--transition-fast);
}

.wpdm-order-row__btn:hover {
    background: var(--accent);
    color: #fff !important;
}

@media (max-width: 768px) {
    .wpdm-order-row__details {
        flex-direction: column;
        align-items: flex-start;
    }

    .wpdm-order-row__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .wpdm-order-row__actions {
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid var(--border-light);
    }

    .wpdm-order-row__btn {
        flex: 1;
        justify-content: center;
    }
}

/* ==========================================================================
   20. Theme Overrides
   ========================================================================== */

.wpdm-dashboard .form-control {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.wpdm-dashboard .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.wpdm-dashboard .input-group {
    display: flex;
    align-items: stretch;
}

.wpdm-dashboard .input-group .form-control {
    flex: 1;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.wpdm-dashboard .input-group .form-control:focus {
    z-index: 1;
}

.wpdm-dashboard .input-group-append {
    display: flex;
}

.wpdm-dashboard .input-group-append .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-left: 0;
}

.wpdm-dashboard .input-group-lg .form-control {
    padding: 12px 16px;
    font-size: 15px;
}

.wpdm-dashboard .input-group-lg .btn {
    padding: 12px 20px;
    font-size: 15px;
}

.wpdm-dashboard .table {
    margin-bottom: 0;
}

.wpdm-dashboard .table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--border-light);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
}

.wpdm-dashboard .table td {
    padding: 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.wpdm-dashboard .table tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.02);
}

/* ==========================================================================
   21. Mobile Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .wpdm-dashboard-frame {
        border-radius: var(--radius-lg);
    }

    .wpdm-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        border-radius: 0;
    }

    .wpdm-sidebar.open {
        transform: translateX(0);
    }

    .wpdm-mobile-toggle {
        display: flex;
    }

    .wpdm-overlay {
        display: block;
        pointer-events: none;
    }

    .wpdm-overlay.visible {
        pointer-events: auto;
    }

    .wpdm-main-inner {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .wpdm-dashboard-frame {
        border-radius: var(--radius-md);
    }

    .wpdm-card-header,
    .wpdm-card-body,
    .wpdm-card-footer {
        padding: 14px 16px;
    }

    .wpdm-stat-card {
        padding: 14px;
    }

    .wpdm-stat-value {
        font-size: 20px;
    }
}

/* ==========================================================================
   22. Edit Profile Specific
   ========================================================================== */

#edit-profile-form .card,
#edit-profile-form .wpdm-card {
    margin-bottom: 20px;
}

.wpdm-dashboard .card-body .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.wpdm-dashboard .card-body .form-group {
    padding: 0 10px;
    margin-bottom: 16px;
}

.wpdm-dashboard .card-body .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

@media (max-width: 767px) {
    .wpdm-dashboard .card-body .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.wpdm-dashboard .card-body label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.wpdm-dashboard .card-body select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
}

/* ==========================================================================
   23. DropZone Page
   ========================================================================== */

/* DropZone Layout */
.wpdm-dashboard .container {
    max-width: 100%;
    padding: 0;
}

.wpdm-dashboard .container > .row {
    display: flex;
    gap: 24px;
    margin: 0;
}

.wpdm-dashboard .container > .row:not(.dz-stats-row) > .col-md-8,
.wpdm-dashboard .container > .row:not(.dz-stats-row) > .col-md-4 {
    padding: 0;
}

.wpdm-dashboard .container > .row:not(.dz-stats-row) > .col-md-8 {
    flex: 1;
    max-width: none;
}

.wpdm-dashboard .container > .row:not(.dz-stats-row) > .col-md-4 {
    flex: 0 0 320px;
    max-width: 320px;
}

/* Feature Cards (Stats) - 3 Column Layout */
.wpdm-dashboard .dz-stats-row,
.w3eden .dz-stats-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 0 0 16px 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

.wpdm-dashboard .dz-stats-row > div,
.wpdm-dashboard .dz-stats-row > .col-md-4,
.wpdm-dashboard .dz-stats-row > [class*="col-"],
.w3eden .dz-stats-row > div,
.w3eden .dz-stats-row > .col-md-4,
.w3eden .dz-stats-row > [class*="col-"] {
    padding: 0 !important;
    max-width: none !important;
    width: auto !important;
    flex: unset !important;
    flex-basis: auto !important;
    min-width: 0 !important;
}

.wpdm-dashboard .feature-card,
.w3eden .dz-stats-row .feature-card {
    border: 1px solid var(--border-color) !important;
    background: var(--content-bg) !important;
    box-shadow: var(--shadow-sm) !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-fast);
    margin-bottom: 0 !important;
    height: 100%;
    width: 100% !important;
    overflow: visible !important;
}

.wpdm-dashboard .feature-card:hover,
.w3eden .dz-stats-row .feature-card:hover {
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-2px);
}

.wpdm-dashboard .feature-card .card-body,
.w3eden .dz-stats-row .feature-card .card-body {
    padding: 16px !important;
    height: 100%;
    display: flex;
    align-items: center;
    overflow: visible !important;
}

.wpdm-dashboard .feature-card .media,
.w3eden .dz-stats-row .feature-card .media {
    width: 100%;
    overflow: visible !important;
}

.wpdm-dashboard .feature-card .media-body,
.w3eden .dz-stats-row .feature-card .media-body {
    overflow: visible !important;
}

.wpdm-dashboard .feature-card .icn,
.w3eden .dz-stats-row .feature-card .icn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, var(--accent, var(--color-info)) 0%, var(--accent-hover, var(--color-info-active)) 100%) !important;
    border-radius: var(--radius-md, 8px) !important;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb, var(--color-info-rgb)), 0.25);
}

.wpdm-dashboard .feature-card .nt,
.w3eden .dz-stats-row .feature-card .nt {
    font-size: 11px !important;
    font-weight: 600;
    color: var(--text-muted, #64748b) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wpdm-dashboard .feature-card h3,
.w3eden .dz-stats-row .feature-card h3 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--text-primary, #1e293b) !important;
    margin: 2px 0 0 0 !important;
}

/* Upload Card */
.wpdm-dashboard .feature-card.upload-card,
.w3eden .dz-stats-row .feature-card.upload-card {
    transition: all 0.2s ease;
    height: 100%;
    min-height: 100%;
}

.wpdm-dashboard .feature-card.upload-card .card-body,
.w3eden .dz-stats-row .feature-card.upload-card .card-body {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpdm-dashboard .feature-card.upload-card .media,
.w3eden .dz-stats-row .feature-card.upload-card .media {
    width: auto;
    align-items: center;
    justify-content: center;
}

.wpdm-dashboard .feature-card.upload-card:hover,
.w3eden .dz-stats-row .feature-card.upload-card:hover {
    border-color: var(--color-success, #10b981) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15) !important;
}

.wpdm-dashboard .feature-card.upload-card .icn-upload,
.w3eden .dz-stats-row .feature-card.upload-card .icn-upload {
    background: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    font-size: 24px !important;
    color: #10b981 !important;
}

.wpdm-dashboard .feature-card.upload-card .upload-label,
.w3eden .dz-stats-row .feature-card.upload-card .upload-label {
    font-size: 13px !important;
    font-weight: 700;
    color: #10b981 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 991px) {
    .wpdm-dashboard .dz-stats-row,
    .w3eden .dz-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .wpdm-dashboard .dz-stats-row > div:last-child,
    .w3eden .dz-stats-row > div:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .wpdm-dashboard .dz-stats-row,
    .w3eden .dz-stats-row {
        grid-template-columns: 1fr;
    }

    .wpdm-dashboard .dz-stats-row > div:last-child,
    .w3eden .dz-stats-row > div:last-child {
        grid-column: auto;
    }
}

/* File List */
.wpdm-dashboard #__myfiles {
    margin-top: 16px !important;
}

.wpdm-dashboard #__myfiles .card {
    background: var(--content-bg);
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 8px !important;
    transition: all var(--transition-fast);
}

.wpdm-dashboard #__myfiles .card:hover {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.08) !important;
}

.wpdm-dashboard #__myfiles .card .media {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wpdm-dashboard #__myfiles .card .media img {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px;
    object-fit: contain;
    padding: 8px;
    background: var(--main-bg);
    border-radius: var(--radius-sm);
}

.wpdm-dashboard #__myfiles .filet {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wpdm-dashboard #__myfiles .text-small {
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

.wpdm-dashboard #__myfiles .text-small i {
    opacity: 0.6;
}

/* File Action Buttons */
.wpdm-dashboard #__myfiles ._fsettings {
    display: flex !important;
    gap: 6px;
    width: auto !important;
    height: auto !important;
    opacity: 0;
    transition: all var(--transition-fast);
}

.wpdm-dashboard #__myfiles .card:hover ._fsettings {
    opacity: 1;
}

.wpdm-dashboard #__myfiles ._fsettings .btn {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm) !important;
    font-size: 13px;
}

.wpdm-dashboard #__myfiles ._fsettings .btn-secondary {
    background: var(--main-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.wpdm-dashboard #__myfiles ._fsettings .btn-secondary:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.wpdm-dashboard #__myfiles ._fsettings .btn-info {
    background: rgba(14, 165, 233, 0.1);
    border-color: transparent;
    color: #0ea5e9;
}

.wpdm-dashboard #__myfiles ._fsettings .btn-info:hover {
    background: #0ea5e9;
    color: #fff;
}

.wpdm-dashboard #__myfiles ._fsettings .btn-primary {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: transparent;
    color: var(--accent);
}

.wpdm-dashboard #__myfiles ._fsettings .btn-primary:hover {
    background: var(--accent);
    color: #fff;
}

.wpdm-dashboard #__myfiles ._fsettings .btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: transparent;
    color: #ef4444;
}

.wpdm-dashboard #__myfiles ._fsettings .btn-danger:hover {
    background: #ef4444;
    color: #fff;
}

/* Dropzone Upload Area */
.wpdm-dashboard #drag-drop-area {
    border: 2px dashed var(--border-color) !important;
    background: var(--content-bg) !important;
    border-radius: var(--radius-lg) !important;
    transition: all var(--transition-fast);
}

.wpdm-dashboard .drag-drop.drag-over #drag-drop-area,
.wpdm-dashboard #drag-drop-area:hover {
    border-color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.04) !important;
}

.wpdm-dashboard #drag-drop-area .drag-drop-inside {
    padding: 60px 20px !important;
    text-align: center;
}

.wpdm-dashboard #drag-drop-area .fa-arrow-up-from-bracket {
    font-size: 40px !important;
    color: var(--accent);
    opacity: 0.6;
    margin-bottom: 16px;
}

.wpdm-dashboard #drag-drop-area .drag-drop-info {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.wpdm-dashboard #drag-drop-area p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.wpdm-dashboard #plupload-browse-button {
    padding: 12px 28px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
    transition: all var(--transition-fast);
}

.wpdm-dashboard #plupload-browse-button:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.4);
}

/* Upload Progress */
.wpdm-dashboard #filelist .card {
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.wpdm-dashboard #filelist .card-header {
    background: var(--main-bg);
    font-size: 13px;
    padding: 10px 14px !important;
}

.wpdm-dashboard #filelist .progress {
    height: 6px;
    border-radius: 3px;
    background: var(--border-light);
}

.wpdm-dashboard #filelist .progress-bar {
    height: 6px !important;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%) !important;
    border-radius: 3px;
}

/* No Files State */
.wpdm-dashboard #__nofiles {
    background: var(--content-bg) !important;
    border: 2px dashed var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-muted);
    font-size: 15px;
}

/* Responsive */
@media (max-width: 991px) {
    .wpdm-dashboard .container > .row:not(.dz-stats-row) {
        flex-direction: column;
    }

    .wpdm-dashboard .container > .row:not(.dz-stats-row) > .col-md-4 {
        flex: none;
        max-width: 100%;
        order: -1;
        margin-bottom: 20px;
    }

    .wpdm-dashboard #drag-drop-area .drag-drop-inside {
        padding: 40px 20px !important;
    }
}
