/**
 * User Dashboard Styles
 * Custom Shirt Designer Plugin
 */

/* Dashboard Container */
.csd-user-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Dashboard Header */
.csd-dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.csd-dashboard-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.csd-welcome {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
}

/* Login Required */
.csd-dashboard-login-required {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.csd-dashboard-login-required p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #4b5563;
}

/* Tab Navigation */
.csd-dashboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
}

.csd-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
}

.csd-tab-btn:hover {
    color: #374151;
    background: #f3f4f6;
}

.csd-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

.csd-tab-icon {
    font-size: 18px;
}

/* Tab Content */
.csd-tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

.csd-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading State */
.csd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.csd-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.csd-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px dashed #d1d5db;
}

.csd-empty-icon {
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
}

.csd-empty-state p {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 16px;
}

/* Buttons */
.csd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.csd-btn-primary {
    background: #2563eb;
    color: #fff;
}

.csd-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.csd-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.csd-btn-secondary:hover {
    background: #e5e7eb;
}

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

.csd-btn-icon {
    font-size: 16px;
}

/* Orders List */
.csd-orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Order Card */
.csd-order-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: box-shadow 0.2s ease;
}

.csd-order-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.csd-order-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.csd-order-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.csd-order-number {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
}

.csd-order-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.csd-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.csd-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.csd-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.csd-order-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.csd-order-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.csd-order-actions {
    display: flex;
    gap: 8px;
}

.csd-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.csd-download-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.csd-download-btn.downloading {
    opacity: 0.7;
    pointer-events: none;
}

/* AI Gallery */
.csd-ai-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.csd-ai-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.csd-ai-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.csd-ai-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f3f4f6;
}

.csd-ai-details {
    padding: 16px;
}

.csd-ai-prompt {
    font-size: 14px;
    color: #374151;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.csd-ai-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

/* Library Grid */
.csd-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.csd-library-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.csd-library-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.csd-library-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #f9fafb;
    padding: 10px;
}

.csd-library-details {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
}

.csd-library-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csd-library-meta {
    font-size: 12px;
    color: #9ca3af;
}

/* Pagination */
.csd-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.csd-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.csd-page-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.csd-page-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.csd-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.csd-page-info {
    font-size: 14px;
    color: #6b7280;
    margin: 0 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .csd-user-dashboard {
        padding: 12px;
    }

    .csd-dashboard-header h2 {
        font-size: 22px;
    }

    .csd-dashboard-tabs {
        flex-wrap: wrap;
    }

    .csd-tab-btn {
        flex: 1;
        min-width: 100px;
        padding: 10px 12px;
        font-size: 13px;
        justify-content: center;
    }

    .csd-order-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .csd-order-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .csd-download-btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .csd-ai-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .csd-pagination {
        flex-wrap: wrap;
    }
}
