/**
 * Common styles for SW AI Print Generator.
 */

/* Force full-width layout when plugin shortcodes are used */
body:has(.sw-ai-print-generator),
body:has(.sw-city-memory-challenge) {
    #main-content,
    .container,
    #content-area,
    .et_pb_row,
    article.post,
    article.page,
    .entry-content {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 5% !important;
        padding-right: 5% !important;
    }
    
    #sidebar,
    .et_right_sidebar #sidebar,
    aside#sidebar,
    .widget-area {
        display: none !important;
    }
}

/* CSS Variables */
:root {
    --sw-ai-primary: #1a1a1a;
    --sw-ai-primary-hover: #333;
    --sw-ai-secondary: #f5f5f5;
    --sw-ai-accent: #2563eb;
    --sw-ai-success: #10b981;
    --sw-ai-error: #ef4444;
    --sw-ai-warning: #f59e0b;
    --sw-ai-border: #e5e7eb;
    --sw-ai-text: #1f2937;
    --sw-ai-text-light: #6b7280;
    --sw-ai-radius: 8px;
    --sw-ai-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --sw-ai-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --sw-ai-transition: all 0.2s ease;
}

/* Base Components */
.sw-ai-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    border: none;
    border-radius: var(--sw-ai-radius);
    cursor: pointer;
    transition: var(--sw-ai-transition);
}

.sw-ai-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sw-ai-button-primary {
    background: var(--sw-ai-primary);
    color: #fff;
}

.sw-ai-button-primary:hover:not(:disabled) {
    background: var(--sw-ai-primary-hover);
}

.sw-ai-button-secondary {
    background: var(--sw-ai-secondary);
    color: var(--sw-ai-text);
    border: 1px solid var(--sw-ai-border);
}

.sw-ai-button-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

/* Spinner */
.sw-ai-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: sw-ai-spin 0.8s linear infinite;
}

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

/* Message */
.sw-ai-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: var(--sw-ai-radius);
    font-size: 14px;
}

.sw-ai-message-error {
    background: #fef2f2;
    color: var(--sw-ai-error);
    border: 1px solid #fecaca;
}

.sw-ai-message-success {
    background: #f0fdf4;
    color: var(--sw-ai-success);
    border: 1px solid #bbf7d0;
}

.sw-ai-message-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    line-height: 1;
}

.sw-ai-message-close:hover {
    opacity: 1;
}

/* Loading Overlay */
.sw-ai-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sw-ai-loading-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.sw-ai-loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--sw-ai-border);
    border-top-color: var(--sw-ai-primary);
    border-radius: 50%;
    animation: sw-ai-spin 1s linear infinite;
    margin: 0 auto 24px;
}

.sw-ai-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--sw-ai-text);
    margin-bottom: 8px;
}

.sw-ai-loading-subtext {
    font-size: 14px;
    color: var(--sw-ai-text-light);
}

/* Error state */
.sw-ai-error {
    color: var(--sw-ai-error);
    padding: 20px;
    text-align: center;
    background: #fef2f2;
    border-radius: var(--sw-ai-radius);
}
