/* ===== Claude Content Generator - Frontend Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

.ccg-app {
    --bg:       #0a0a0f;
    --surface:  #111118;
    --surface2: #1a1a25;
    --border:   #2a2a3d;
    --accent:   #6c63ff;
    --accent2:  #ff6584;
    --accent3:  #43e97b;
    --text:     #e8e8f0;
    --text-dim: #888899;
    --glow:     rgba(108,99,255,0.25);
    --shadow:   0 4px 30px rgba(0,0,0,0.35);

    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    background: var(--bg);
    color: var(--text);
    border-radius: 20px;
    overflow: hidden;
    padding: 0;
    transition: background 0.4s, color 0.4s;
    position: relative;
}

.ccg-app::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 10%, rgba(108,99,255,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 80% 80%, rgba(255,101,132,0.05) 0%, transparent 60%);
    pointer-events: none;
}

/* Light mode */
.ccg-app[data-theme="light"] {
    --bg:       #f0f2f8;
    --surface:  #ffffff;
    --surface2: #f5f7ff;
    --border:   #dde0f0;
    --text:     #1a1a2e;
    --text-dim: #6b6b8a;
    --shadow:   0 4px 20px rgba(108,99,255,0.1);
}

.ccg-app * { box-sizing: border-box; }

/* App Header */
.ccg-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: relative;
}

.ccg-app-header::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.ccg-branding { display: flex; align-items: center; gap: 14px; }

.ccg-brand-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
    box-shadow: 0 4px 15px var(--glow);
}

.ccg-branding h2 { font-size: 18px; font-weight: 800; color: var(--text); margin: 0; }
.ccg-branding p  { font-size: 12px; color: var(--text-dim); margin: 2px 0 0; }

.ccg-theme-toggle-inline {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 7px 16px;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.3s;
    color: var(--text);
}
.ccg-theme-toggle-inline:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--glow); }

.ccg-app[data-theme="dark"] .icon-sun  { display: block; }
.ccg-app[data-theme="dark"] .icon-moon { display: none; }
.ccg-app[data-theme="light"] .icon-sun  { display: none; }
.ccg-app[data-theme="light"] .icon-moon { display: block; }

/* Sections */
.ccg-section {
    background: var(--surface);
    margin: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: background 0.4s;
}

.ccg-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

.ccg-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ccg-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ccg-optional { font-size: 10px; color: var(--text-dim); text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Fields */
.ccg-field-group { margin-bottom: 18px; }
.ccg-field-group:last-child { margin-bottom: 0; }

.ccg-field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.ccg-field-group input[type="text"],
.ccg-field-group select,
.ccg-field-group textarea,
.ccg-keyword,
.ccg-related-kw {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    direction: rtl;
    resize: vertical;
}

.ccg-keyword,
.ccg-related-kw,
.ccg-brief,
.ccg-sources,
.ccg-content-type {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    direction: rtl;
    resize: vertical;
}

.ccg-keyword:focus, .ccg-related-kw:focus,
.ccg-brief:focus,   .ccg-sources:focus,
.ccg-content-type:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
}

.ccg-content-type option { background: #1a1a25; }

/* Row */
.ccg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Range */
.ccg-word-count {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    cursor: pointer;
    border: none;
    outline: none;
    margin-bottom: 4px;
}
.ccg-word-count::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; height: 22px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--glow);
    cursor: pointer;
    transition: transform 0.2s;
}
.ccg-word-count::-webkit-slider-thumb:hover { transform: scale(1.2); }

.ccg-range-labels {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-dim); margin-top: 4px;
}

/* Tone Tags */
.ccg-tone-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.ccg-tone {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-dim);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.ccg-tone:hover  { border-color: var(--accent); color: var(--accent); }
.ccg-tone.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 12px var(--glow); }

/* Generate Button */
.ccg-generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 18px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
    letter-spacing: 0.02em;
}
.ccg-generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px var(--glow);
}
.ccg-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ccg-btn-icon { font-size: 18px; }

/* Loading */
.ccg-loading {
    text-align: center;
    padding: 40px 20px;
}
.ccg-spinner {
    width: 44px; height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ccgSpin 0.8s linear infinite;
    margin: 0 auto 14px;
}
.ccg-loading p { color: var(--text-dim); font-size: 14px; }

/* Error */
.ccg-error {
    margin: 0 20px 20px;
    background: rgba(255,101,132,0.08);
    border: 1px solid rgba(255,101,132,0.3);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--accent2);
    font-size: 14px;
}

/* Inline notice */
.ccg-notice-inline {
    margin: 20px;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 13px;
}
.ccg-notice-warning {
    background: rgba(255,193,7,0.08);
    border: 1px solid rgba(255,193,7,0.3);
    color: #ffc107;
}

/* Output */
.ccg-output {
    margin: 0 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    animation: ccgFadeIn 0.4s ease;
}

.ccg-output-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.ccg-word-badge {
    background: rgba(67,233,123,0.12);
    border: 1px solid rgba(67,233,123,0.3);
    color: var(--accent3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.ccg-copy-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    padding: 7px 14px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 4px;
}
.ccg-copy-btn:hover { border-color: var(--accent); color: var(--accent); }

.ccg-output-body {
    padding: 24px;
    font-size: 15px;
    line-height: 2;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    direction: rtl;
}

.ccg-output-body::-webkit-scrollbar { width: 6px; }
.ccg-output-body::-webkit-scrollbar-track { background: var(--surface2); }
.ccg-output-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Cursor */
.ccg-cursor {
    display: inline-block;
    width: 2px; height: 18px;
    background: var(--accent);
    animation: ccgBlink 1s infinite;
    vertical-align: middle;
    margin-right: 2px;
}

/* Animations */
@keyframes ccgSpin    { to { transform: rotate(360deg); } }
@keyframes ccgBlink   { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes ccgFadeIn  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
    .ccg-row { grid-template-columns: 1fr; }
    .ccg-section { margin: 12px; padding: 16px; }
    .ccg-generate-btn { width: calc(100% - 24px); margin: 0 12px 12px; }
}
