/* BoxUpdater UI - Global Styles */

:root {
    /* Theme colors - Green/Teal for BoxUpdater */
    --theme-backgroundApp: #EEF2F6;
    --theme-panelBackground: #FFFFFF;
    --theme-border: #C9D4E2;
    --theme-text: #111827;
    --theme-mutedText: #6B7280;
    --theme-header: #1E6F5C;
    --theme-sidebar: #2B3E3A;
    --theme-accentPrimary: #29A19C;
    --theme-accentSecondary: #A3E4D7;
    --theme-success: #10B981;
    --theme-warning: #F59E0B;
    --theme-error: #EF4444;
    --theme-info: #3B82F6;

    /* Semantic names */
    --color-app-bg: var(--theme-backgroundApp);
    --color-surface-bg: var(--theme-panelBackground);
    --color-border: var(--theme-border);
    --color-text: var(--theme-text);
    --color-text-muted: var(--theme-mutedText);
    --color-primary: var(--theme-accentPrimary);
    --color-header: var(--theme-header);
    --color-sidebar: var(--theme-sidebar);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-app-bg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--theme-header);
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #B8C5D6;
}

.btn-danger {
    background: var(--theme-error);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-success {
    background: var(--theme-success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form elements */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: white;
    color: var(--color-text);
    transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(41, 161, 156, 0.15);
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-text);
}

.form-row {
    margin-bottom: 16px;
}

.form-row-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-row-inline label {
    margin-bottom: 0;
    min-width: 100px;
}

.form-row-inline input,
.form-row-inline select {
    flex: 1;
}

/* Cards */
.card {
    background: var(--color-surface-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.card-header h3 {
    margin: 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-app-bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

tr:hover td {
    background: #F9FAFB;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-error {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-muted {
    background: #E5E7EB;
    color: #4B5563;
}

/* Messages */
.msg {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.msg-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.msg-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.msg-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.msg-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* Utility classes */
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--theme-success); }
.text-warning { color: var(--theme-warning); }
.text-error { color: var(--theme-error); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

.hidden { display: none !important; }

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
}

.empty-state p {
    margin-top: 8px;
}
