/* WordPress Management System Styles */

:root {
    --primary-color: #1976d2;
    --secondary-color: #7c4dff;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
}

html, body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

#app {
    height: 100%;
}

/* Loading Screen */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    font-size: 18px;
    font-weight: 500;
    opacity: 0.9;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: var(--error-color);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    margin-left: 10px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* MudBlazor Overrides */
.mud-appbar {
    backdrop-filter: blur(8px);
}

.mud-table {
    border-radius: 8px;
}

.mud-card {
    border-radius: 12px;
}

.mud-paper {
    border-radius: 8px;
}

.mud-button-filled {
    border-radius: 8px;
    text-transform: none;
    font-weight: 500;
}

.mud-chip {
    border-radius: 6px;
    font-weight: 500;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Product Image Placeholder */
.product-image-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Website Selector */
.website-selector {
    min-width: 200px;
}

/* Responsive Fixes */
@media (max-width: 600px) {
    .mud-table {
        font-size: 14px;
    }

    .website-selector {
        min-width: 120px;
        max-width: 160px;
    }
}

/* Quill Rich Text Editor Styles */
.rich-text-editor .ql-container {
    min-height: 280px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
}

.rich-text-editor .ql-toolbar {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background: #f9f9f9;
}

.rich-text-editor .ql-editor {
    min-height: 280px;
    max-height: 560px;
    overflow-y: auto;
}

.rich-text-editor .ql-editor.ql-blank::before {
    color: rgba(0, 0, 0, 0.38);
    font-style: normal;
}

/* Dark mode support for Quill */
.mud-theme-dark .rich-text-editor .ql-toolbar {
    background: #333;
    border-color: #555;
}

.mud-theme-dark .rich-text-editor .ql-container {
    border-color: #555;
    background: #1e1e1e;
    color: #e0e0e0;
}

.mud-theme-dark .rich-text-editor .ql-editor.ql-blank::before {
    color: rgba(255, 255, 255, 0.38);
}

/* Media Picker Dialog */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.media-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9f9f9;
}

.media-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.media-item-selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.media-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.media-placeholder {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #999;
}

.media-title {
    padding: 6px 8px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: white;
    border-top: 1px solid #eee;
}

.mud-theme-dark .media-item {
    border-color: #444;
    background: #2a2a2a;
}

.mud-theme-dark .media-title {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

.mud-theme-dark .media-placeholder {
    background: #333;
    color: #666;
}
