/**
 * Storeden Google Shopping Feed Plugin - Custom Styles
 * Based on ClientsView style patterns
 */

/* ===== CSS Variables ===== */
:root {
    --storeden-primary: #2563eb;
    --storeden-primary-dark: #1d4ed8;
    --storeden-primary-light: #3b82f6;
    --storeden-secondary: #0f172a;
    --storeden-accent: #06b6d4;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ===== Base ===== */
body {
    font-family: var(--font-family);
    background-color: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    margin: 0;
}

/* ===== Install Page ===== */
.install-page {
    background: linear-gradient(135deg, var(--storeden-secondary) 0%, var(--gray-800) 50%, var(--storeden-primary-dark) 100%);
    min-height: 100vh;
}

.install-card {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 420px;
}

.install-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--storeden-primary) 0%, var(--storeden-accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.install-icon i {
    font-size: 2rem;
    color: white;
}

.permissions-box,
.info-box {
    background-color: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1rem;
}

/* ===== Buttons ===== */
.btn-storeden {
    background: linear-gradient(135deg, var(--storeden-primary) 0%, var(--storeden-primary-dark) 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.btn-storeden:hover {
    background: linear-gradient(135deg, var(--storeden-primary-light) 0%, var(--storeden-primary) 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== Dashboard ===== */
.dashboard-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-page main {
    flex: 1;
}

/* Navbar */
.bg-storeden {
    background: linear-gradient(90deg, var(--storeden-secondary) 0%, var(--gray-800) 100%);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
}

/* KPI Cards */
.kpi-card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    background: white;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon i {
    font-size: 1.25rem;
}

/* Cards */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: white;
}

.card-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 0.875rem 1rem;
    background: white;
}

/* Footer */
footer {
    background-color: white;
    border-top: 1px solid var(--gray-200);
}

/* Forms */
.form-control,
.form-select {
    border-color: var(--gray-300);
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--storeden-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group-text {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-500);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.6em;
    font-size: 0.7rem;
}

/* Utilities */
.bg-primary-subtle { background-color: rgba(37, 99, 235, 0.1) !important; }
.bg-success-subtle { background-color: rgba(16, 185, 129, 0.1) !important; }
.bg-warning-subtle { background-color: rgba(245, 158, 11, 0.1) !important; }
.bg-info-subtle { background-color: rgba(6, 182, 212, 0.1) !important; }

.text-primary { color: var(--storeden-primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--storeden-accent) !important; }

/* Links */
a {
    color: var(--storeden-primary);
    text-decoration: none;
}

a:hover {
    color: var(--storeden-primary-dark);
    text-decoration: underline;
}

/* Code */
code {
    background-color: var(--gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--gray-700);
}

/* List Group */
.list-group-item {
    border-left: none;
    border-right: none;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Debug */
#debugSection pre {
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .kpi-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .kpi-icon i {
        font-size: 1rem;
    }

    .kpi-card h3 {
        font-size: 1.25rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.25s ease-out;
}

/* Error Page */
.error-page {
    background: linear-gradient(135deg, var(--storeden-secondary) 0%, var(--gray-800) 50%, var(--storeden-primary-dark) 100%);
    min-height: 100vh;
}

.error-card {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 420px;
}

.error-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.error-icon i {
    font-size: 2rem;
    color: white;
}
