/* NoCostTools Embed Widget Styles — v1.0 */
/* Ultra-lightweight shared CSS for all embeddable widgets */

:root {
    --nct-accent: #4f8cfe;
    --nct-accent-light: #e8f0ff;
    --nct-bg: #ffffff;
    --nct-bg-secondary: #f7f8fa;
    --nct-text: #1a1a2e;
    --nct-text-muted: #6b7280;
    --nct-border: #e5e7eb;
    --nct-radius: 10px;
    --nct-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --nct-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Dark Theme */
[data-theme="dark"] {
    --nct-accent: #6ea8fe;
    --nct-accent-light: #1e293b;
    --nct-bg: #0f172a;
    --nct-bg-secondary: #1e293b;
    --nct-text: #e2e8f0;
    --nct-text-muted: #94a3b8;
    --nct-border: #334155;
    --nct-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--nct-font);
    background: var(--nct-bg);
    color: var(--nct-text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Widget Container */
.nct-widget {
    max-width: 100%;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nct-widget-body {
    flex: 1;
}

/* Widget Title */
.nct-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--nct-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nct-title-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--nct-accent), #00c6fb);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}

/* Textarea */
.nct-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid var(--nct-border);
    border-radius: var(--nct-radius);
    padding: 12px;
    font-family: var(--nct-font);
    font-size: 14px;
    color: var(--nct-text);
    background: var(--nct-bg);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.nct-textarea:focus {
    border-color: var(--nct-accent);
    box-shadow: 0 0 0 3px rgba(79, 140, 254, 0.15);
}

.nct-textarea::placeholder {
    color: var(--nct-text-muted);
}

/* Stats Grid */
.nct-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.nct-stat {
    background: var(--nct-bg-secondary);
    border: 1px solid var(--nct-border);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.nct-stat:hover {
    transform: translateY(-2px);
    border-color: var(--nct-accent);
}

.nct-stat-number {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--nct-accent), #00c6fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.nct-stat-label {
    font-size: 10px;
    color: var(--nct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 2px;
}

/* Input */
.nct-input {
    width: 100%;
    border: 2px solid var(--nct-border);
    border-radius: var(--nct-radius);
    padding: 10px 12px;
    font-family: var(--nct-font);
    font-size: 14px;
    color: var(--nct-text);
    background: var(--nct-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.nct-input:focus {
    border-color: var(--nct-accent);
    box-shadow: 0 0 0 3px rgba(79, 140, 254, 0.15);
}

/* Buttons */
.nct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--nct-font);
    text-decoration: none;
}

.nct-btn-primary {
    background: linear-gradient(135deg, var(--nct-accent), #00c6fb);
    color: #fff;
}

.nct-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 140, 254, 0.3);
}

.nct-btn-outline {
    background: transparent;
    color: var(--nct-accent);
    border: 2px solid var(--nct-border);
}

.nct-btn-outline:hover {
    background: var(--nct-accent-light);
    border-color: var(--nct-accent);
}

.nct-btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

/* Input Group */
.nct-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.nct-input-group .nct-input {
    flex: 1;
}

/* Color Value Row */
.nct-color-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.nct-color-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--nct-text-muted);
    min-width: 32px;
    text-transform: uppercase;
}

.nct-color-input {
    flex: 1;
    border: 1px solid var(--nct-border);
    border-radius: 6px;
    padding: 6px 8px;
    font-family: monospace;
    font-size: 12px;
    color: var(--nct-text);
    background: var(--nct-bg-secondary);
    outline: none;
}

.nct-color-copy {
    width: 28px;
    height: 28px;
    border: 1px solid var(--nct-border);
    border-radius: 6px;
    background: var(--nct-bg-secondary);
    color: var(--nct-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}

.nct-color-copy:hover {
    background: var(--nct-accent);
    color: #fff;
    border-color: var(--nct-accent);
}

/* Social Limits */
.nct-social-limits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.nct-social-item {
    background: var(--nct-bg-secondary);
    border: 1px solid var(--nct-border);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.nct-social-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--nct-text-muted);
    margin-bottom: 4px;
}

.nct-social-bar {
    height: 4px;
    background: var(--nct-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 3px;
}

.nct-social-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, var(--nct-accent), #00c6fb);
}

.nct-social-fill.over-limit {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.nct-social-count {
    font-size: 10px;
    color: var(--nct-text-muted);
}

/* QR Code Display */
.nct-qr-display {
    background: #fff;
    border: 2px solid var(--nct-border);
    border-radius: var(--nct-radius);
    padding: 16px;
    text-align: center;
    margin: 12px 0;
}

.nct-qr-display canvas,
.nct-qr-display img {
    max-width: 100%;
    height: auto;
}

/* Color Picker Preview */
.nct-color-preview {
    width: 100%;
    height: 60px;
    border-radius: var(--nct-radius);
    border: 2px solid var(--nct-border);
    margin: 12px 0;
    transition: background-color 0.2s;
}

/* Powered By Footer */
.nct-powered {
    margin-top: auto;
    padding-top: 12px;
    text-align: center;
    border-top: 1px solid var(--nct-border);
}

.nct-powered a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--nct-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nct-powered a:hover {
    color: var(--nct-accent);
}

.nct-powered strong {
    color: var(--nct-text);
    font-weight: 700;
}

[data-theme="dark"] .nct-powered strong {
    color: var(--nct-accent);
}

/* Toast notification */
.nct-toast {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: #1a1a2e;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 999;
    pointer-events: none;
}

.nct-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

[data-theme="dark"] .nct-toast {
    background: #e2e8f0;
    color: #0f172a;
}

/* Responsive */
@media (max-width: 400px) {
    .nct-widget { padding: 10px; }
    .nct-stats { grid-template-columns: repeat(2, 1fr); }
    .nct-stat-number { font-size: 18px; }
    .nct-title { font-size: 14px; }
    .nct-social-limits { grid-template-columns: 1fr; }
}
