/**
 * Vectoron WordPress Plugin - Admin Styles
 *
 * Design System: shadcn/ui inspired, Linear.app aesthetic
 * Matches Vectoron App UI Standards
 *
 * @package Vectoron
 * @version 2.3.0
 */

/* =============================================================================
   CSS VARIABLES - Vectoron Design Tokens
   ============================================================================= */

:root {
    /* Primary Colors */
    --vectoron-primary: #5E6AD2;
    --vectoron-primary-hover: #4F5BC4;
    --vectoron-primary-foreground: #FFFFFF;

    /* Background Colors */
    --vectoron-background: #F7F7F7;
    --vectoron-card: #FFFFFF;
    --vectoron-muted: #F7F7F7;
    --vectoron-accent: #F9F9F9;

    /* Text Colors */
    --vectoron-foreground: #2f2f2f;
    --vectoron-muted-foreground: #6B7280;
    --vectoron-tertiary: #9CA3AF;

    /* Border & State Colors */
    --vectoron-border: #E8EBF0;
    --vectoron-ring: #5E6AD2;

    /* Semantic Colors */
    --vectoron-success: #22C55E;
    --vectoron-success-bg: #dcfce7;
    --vectoron-success-text: #166534;
    --vectoron-warning: #F59E0B;
    --vectoron-warning-bg: #fef3c7;
    --vectoron-warning-text: #92400e;
    --vectoron-destructive: #DC2626;
    --vectoron-destructive-bg: #fee2e2;
    --vectoron-destructive-text: #991b1b;

    /* Shadows - Soft, diffused (Linear-style) */
    --vectoron-shadow-sm: 0 10px 40px rgba(0, 0, 0, 0.04);
    --vectoron-shadow-md: 0 10px 40px rgba(0, 0, 0, 0.06);
    --vectoron-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);

    /* Border Radius */
    --vectoron-radius-sm: 5px;
    --vectoron-radius: 6px;
    --vectoron-radius-md: 8px;
    --vectoron-radius-lg: 12px;

    /* Transitions */
    --vectoron-transition: 200ms ease-out;
    --vectoron-transition-fast: 100ms ease-out;
}

/* =============================================================================
   BASE STYLES & TYPOGRAPHY
   ============================================================================= */

.vectoron-admin-wrap {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 900px;
    margin: 0;
    padding: 24px 20px;
    background: var(--vectoron-background);
    color: var(--vectoron-foreground);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.vectoron-admin-wrap * {
    box-sizing: border-box;
}

/* =============================================================================
   HEADER
   ============================================================================= */

.vectoron-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.vectoron-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.vectoron-header-text h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--vectoron-foreground);
    margin: 0;
    padding: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.vectoron-header-text p {
    font-size: 13px;
    color: var(--vectoron-muted-foreground);
    margin: 2px 0 0 0;
    padding: 0;
}

/* =============================================================================
   CARDS
   ============================================================================= */

.vectoron-card {
    background: var(--vectoron-card);
    border: 1px solid var(--vectoron-border);
    border-radius: var(--vectoron-radius-md);
    box-shadow: var(--vectoron-shadow-sm);
    margin-bottom: 20px;
    transition: box-shadow var(--vectoron-transition), transform var(--vectoron-transition);
}

.vectoron-card:hover {
    box-shadow: var(--vectoron-shadow-md);
}

.vectoron-card-header {
    padding: 16px;
    border-bottom: 1px solid var(--vectoron-border);
}

.vectoron-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--vectoron-foreground);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vectoron-card-title svg {
    width: 18px;
    height: 18px;
    color: var(--vectoron-primary);
}

.vectoron-card-description {
    font-size: 13px;
    color: var(--vectoron-muted-foreground);
    margin: 4px 0 0 0;
    line-height: 1.5;
}

.vectoron-card-content {
    padding: 16px;
}

.vectoron-card-footer {
    padding: 16px;
    border-top: 1px solid var(--vectoron-border);
    background: var(--vectoron-muted);
    border-radius: 0 0 var(--vectoron-radius-md) var(--vectoron-radius-md);
}

/* =============================================================================
   FORM ELEMENTS
   ============================================================================= */

.vectoron-form-group {
    margin-bottom: 16px;
}

.vectoron-form-group:last-child {
    margin-bottom: 0;
}

.vectoron-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--vectoron-foreground);
    margin-bottom: 6px;
}

.vectoron-input,
.vectoron-select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--vectoron-foreground);
    background: var(--vectoron-card);
    border: 1px solid var(--vectoron-border);
    border-radius: var(--vectoron-radius-sm);
    transition: border-color var(--vectoron-transition), box-shadow var(--vectoron-transition);
    outline: none;
}

.vectoron-input:focus,
.vectoron-select:focus {
    border-color: var(--vectoron-ring);
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.15);
}

.vectoron-input:disabled,
.vectoron-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--vectoron-muted);
}

.vectoron-input::placeholder {
    color: var(--vectoron-tertiary);
}

.vectoron-input[type="number"] {
    max-width: 120px;
}

.vectoron-description {
    font-size: 12px;
    color: var(--vectoron-muted-foreground);
    margin-top: 6px;
    line-height: 1.4;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.vectoron-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--vectoron-radius);
    cursor: pointer;
    transition: all var(--vectoron-transition-fast);
    border: none;
    outline: none;
    text-decoration: none;
    line-height: 1.4;
}

.vectoron-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.3);
}

.vectoron-btn-primary {
    background: var(--vectoron-primary);
    color: var(--vectoron-primary-foreground);
}

.vectoron-btn-primary:hover {
    background: var(--vectoron-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--vectoron-shadow-sm);
}

.vectoron-btn-secondary {
    background: var(--vectoron-card);
    color: var(--vectoron-foreground);
    border: 1px solid var(--vectoron-border);
}

.vectoron-btn-secondary:hover {
    background: var(--vectoron-accent);
    border-color: var(--vectoron-border);
}

.vectoron-btn-ghost {
    background: transparent;
    color: var(--vectoron-muted-foreground);
}

.vectoron-btn-ghost:hover {
    background: var(--vectoron-accent);
    color: var(--vectoron-foreground);
}

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

/* =============================================================================
   BADGES & STATUS INDICATORS
   ============================================================================= */

.vectoron-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.vectoron-badge-success {
    background: var(--vectoron-success-bg);
    color: var(--vectoron-success-text);
}

.vectoron-badge-warning {
    background: var(--vectoron-warning-bg);
    color: var(--vectoron-warning-text);
}

.vectoron-badge-error {
    background: var(--vectoron-destructive-bg);
    color: var(--vectoron-destructive-text);
}

.vectoron-badge-muted {
    background: var(--vectoron-muted);
    color: var(--vectoron-muted-foreground);
}

.vectoron-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.vectoron-status-dot-success {
    background: var(--vectoron-success);
}

.vectoron-status-dot-warning {
    background: var(--vectoron-warning);
}

.vectoron-status-dot-error {
    background: var(--vectoron-destructive);
}

/* =============================================================================
   CODE & DEBUG OUTPUT
   ============================================================================= */

.vectoron-code {
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 12px;
    background: var(--vectoron-muted);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--vectoron-foreground);
}

.vectoron-debug-output {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: var(--vectoron-radius-md);
    padding: 16px;
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.vectoron-debug-output .success {
    color: #4ade80;
}

.vectoron-debug-output .error {
    color: #f87171;
}

.vectoron-debug-output .warning {
    color: #fbbf24;
}

.vectoron-debug-output .info {
    color: #60a5fa;
}

/* =============================================================================
   TABLES
   ============================================================================= */

.vectoron-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vectoron-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 500;
    color: var(--vectoron-muted-foreground);
    background: var(--vectoron-muted);
    border-bottom: 1px solid var(--vectoron-border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vectoron-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--vectoron-border);
    color: var(--vectoron-foreground);
}

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

.vectoron-table tr:hover td {
    background: var(--vectoron-accent);
}

/* =============================================================================
   ALERTS & NOTICES
   ============================================================================= */

.vectoron-alert {
    padding: 12px 16px;
    border-radius: var(--vectoron-radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    line-height: 1.5;
}

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

.vectoron-alert-success {
    background: var(--vectoron-success-bg);
    color: var(--vectoron-success-text);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

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

.vectoron-alert-warning {
    background: var(--vectoron-warning-bg);
    color: var(--vectoron-warning-text);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

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

.vectoron-alert-error {
    background: var(--vectoron-destructive-bg);
    color: var(--vectoron-destructive-text);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.vectoron-alert-error svg {
    color: var(--vectoron-destructive);
}

.vectoron-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.vectoron-alert-info svg {
    color: #3b82f6;
}

/* =============================================================================
   SECTION DIVIDER
   ============================================================================= */

.vectoron-divider {
    border: none;
    border-top: 1px solid var(--vectoron-border);
    margin: 24px 0;
}

/* =============================================================================
   GRID LAYOUTS
   ============================================================================= */

.vectoron-grid {
    display: grid;
    gap: 16px;
}

.vectoron-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.vectoron-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .vectoron-grid-2,
    .vectoron-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   STAT ITEMS
   ============================================================================= */

.vectoron-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vectoron-stat-label {
    font-size: 12px;
    color: var(--vectoron-muted-foreground);
    font-weight: 500;
}

.vectoron-stat-value {
    font-size: 14px;
    color: var(--vectoron-foreground);
    font-weight: 500;
}

.vectoron-stat-value .vectoron-code {
    font-weight: 400;
}

/* =============================================================================
   INLINE FORM (Input + Button)
   ============================================================================= */

.vectoron-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vectoron-inline-form .vectoron-input {
    max-width: 150px;
}

/* =============================================================================
   SETTINGS FORM ROW
   ============================================================================= */

.vectoron-settings-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--vectoron-border);
}

.vectoron-settings-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.vectoron-settings-row:first-child {
    padding-top: 0;
}

.vectoron-settings-label {
    width: 160px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--vectoron-foreground);
    padding-top: 8px;
}

.vectoron-settings-field {
    flex: 1;
}

/* =============================================================================
   HIDE WORDPRESS DEFAULT STYLES
   ============================================================================= */

.vectoron-admin-wrap .notice,
.vectoron-admin-wrap .updated,
.vectoron-admin-wrap .error {
    display: none !important;
}

/* Override WordPress default input styles */
.vectoron-admin-wrap input[type="text"],
.vectoron-admin-wrap input[type="number"],
.vectoron-admin-wrap select {
    max-width: none;
    width: auto;
}
