/* ============================================================
   AI Youtuber Assistant — style.css
   Author: Raj Khan | https://aiyukti.in/
   ============================================================ */

/* ---------- Reset / Base ---------- */
.aya-wrapper *,
.aya-wrapper *::before,
.aya-wrapper *::after {
    box-sizing: border-box;
}

.aya-wrapper {
    --aya-red:      #ff0000;
    --aya-red-dark: #c62828;
    --aya-bg:       #0f0f0f;
    --aya-surface:  #1a1a1a;
    --aya-surface2: #242424;
    --aya-border:   #333;
    --aya-text:     #f1f1f1;
    --aya-muted:    #aaa;
    --aya-success:  #2ecc71;
    --aya-radius:   12px;
    --aya-shadow:   0 4px 24px rgba(0,0,0,0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    max-width: 900px;
    margin: 32px auto;
    color: var(--aya-text);
}

/* ---------- Input Panel ---------- */
.aya-input-panel {
    background: var(--aya-surface);
    border: 1px solid var(--aya-border);
    border-radius: var(--aya-radius);
    padding: 32px;
    box-shadow: var(--aya-shadow);
    margin-bottom: 24px;
}

.aya-logo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.aya-logo-icon {
    width: 52px;
    height: 52px;
    background: var(--aya-red);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.aya-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--aya-text);
    line-height: 1.2;
}

.aya-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--aya-muted);
}

/* ---------- Fields ---------- */
.aya-field {
    margin-bottom: 20px;
    position: relative;
}

.aya-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--aya-text);
    margin-bottom: 8px;
}

.aya-field textarea,
.aya-field select,
.aya-field input[type="text"] {
    width: 100%;
    background: var(--aya-surface2);
    border: 1px solid var(--aya-border);
    border-radius: 8px;
    color: var(--aya-text);
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    resize: vertical;
}

.aya-field textarea:focus,
.aya-field select:focus {
    border-color: var(--aya-red);
    box-shadow: 0 0 0 3px rgba(255,0,0,0.15);
}

.aya-char-count {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 12px;
    color: var(--aya-muted);
    pointer-events: none;
}

.aya-options-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.aya-field-inline {
    flex: 1;
    min-width: 160px;
}

/* ---------- Buttons ---------- */
.aya-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.aya-btn-primary {
    background: linear-gradient(135deg, var(--aya-red), var(--aya-red-dark));
    color: #fff;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(255,0,0,0.3);
}

.aya-btn-primary:hover {
    background: linear-gradient(135deg, #ff2222, #b71c1c);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,0,0,0.4);
}

.aya-btn-primary:active {
    transform: translateY(0);
}

.aya-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.aya-btn-outline {
    background: transparent;
    border: 1px solid var(--aya-border);
    color: var(--aya-text);
    font-size: 13px;
    padding: 8px 16px;
}

.aya-btn-outline:hover {
    border-color: var(--aya-red);
    color: var(--aya-red);
}

.aya-btn-ghost {
    background: transparent;
    color: var(--aya-muted);
    border: none;
    font-size: 13px;
    padding: 8px 12px;
}

.aya-btn-ghost:hover {
    color: var(--aya-text);
}

.aya-copy-btn {
    background: var(--aya-surface2);
    border: 1px solid var(--aya-border);
    color: var(--aya-muted);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.aya-copy-btn:hover,
.aya-copy-btn.copied {
    background: var(--aya-success);
    border-color: var(--aya-success);
    color: #fff;
}

/* ---------- Error ---------- */
.aya-error {
    background: rgba(255,0,0,0.1);
    border: 1px solid rgba(255,0,0,0.3);
    border-radius: 8px;
    padding: 14px 18px;
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 16px;
}

/* ---------- Results Panel ---------- */
.aya-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aya-result-actions-top {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px 20px;
    background: var(--aya-surface);
    border: 1px solid var(--aya-border);
    border-radius: var(--aya-radius);
}

.aya-result-section {
    background: var(--aya-surface);
    border: 1px solid var(--aya-border);
    border-radius: var(--aya-radius);
    overflow: hidden;
    box-shadow: var(--aya-shadow);
}

.aya-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--aya-border);
    background: var(--aya-surface2);
}

.aya-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--aya-text);
}

.aya-copy-section {
    background: transparent;
    border: 1px solid var(--aya-border);
    color: var(--aya-muted);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.aya-copy-section:hover {
    border-color: var(--aya-red);
    color: var(--aya-red);
}

/* ---------- Titles ---------- */
.aya-titles-list {
    list-style: none;
    margin: 0;
    padding: 12px 0;
}

.aya-titles-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--aya-border);
    transition: background 0.15s;
}

.aya-titles-list li:last-child {
    border-bottom: none;
}

.aya-titles-list li:hover {
    background: var(--aya-surface2);
}

.aya-title-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--aya-red), var(--aya-red-dark));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aya-title-text {
    flex: 1;
    font-size: 15px;
    color: var(--aya-text);
    line-height: 1.4;
}

/* ---------- Description ---------- */
.aya-description-box {
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--aya-muted);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- Tags ---------- */
.aya-tags-container {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.aya-tag {
    background: var(--aya-surface2);
    border: 1px solid var(--aya-border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    color: var(--aya-text);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.aya-tag:hover {
    border-color: var(--aya-red);
    color: var(--aya-red);
    background: rgba(255,0,0,0.07);
}

.aya-tag.copied {
    border-color: var(--aya-success);
    color: var(--aya-success);
    background: rgba(46,204,113,0.1);
}

/* ---------- Thumbnail Prompts ---------- */
#aya-thumbnail-prompts {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.aya-thumb-prompt {
    background: var(--aya-surface2);
    border: 1px solid var(--aya-border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.aya-thumb-num {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff6b35, #ff0000);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aya-thumb-text {
    flex: 1;
    font-size: 14px;
    color: var(--aya-muted);
    line-height: 1.6;
}

/* ---------- Chapters ---------- */
.aya-chapters-list {
    list-style: none;
    margin: 0;
    padding: 12px 0;
}

.aya-chapters-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--aya-border);
    font-size: 14px;
    color: var(--aya-muted);
}

.aya-chapters-list li:last-child {
    border-bottom: none;
}

.aya-chapter-stamp {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--aya-red);
    min-width: 60px;
}

/* ---------- Footer Credit ---------- */
.aya-footer-credit {
    text-align: center;
    font-size: 12px;
    color: var(--aya-muted);
    padding-top: 8px;
}

.aya-footer-credit a {
    color: var(--aya-red);
    text-decoration: none;
}

/* ---------- Spinner ---------- */
.aya-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Admin styles ---------- */
.aya-admin-wrap h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aya-admin-wrap .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #ff0000;
}

.aya-admin-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    max-width: 900px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.aya-info-box {
    background: #fff8f0;
    border-color: #f0c040;
}

.aya-info-box ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.aya-info-box li {
    padding: 6px 0;
    font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .aya-wrapper {
        margin: 12px;
    }

    .aya-input-panel {
        padding: 20px 16px;
    }

    .aya-options-row {
        flex-direction: column;
    }

    .aya-result-actions-top {
        flex-wrap: wrap;
    }

    .aya-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .aya-titles-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
