/* ═══════════════════════════════════════════
   DeepSeek Prompts Generator - Styles v1.0.0
   ═══════════════════════════════════════════ */

:root {
    --dsp-primary: #4F46E5;
    --dsp-primary-hover: #4338CA;
    --dsp-primary-light: #EEF2FF;
    --dsp-accent: #10B981;
    --dsp-accent-hover: #059669;
    --dsp-bg: #F8FAFC;
    --dsp-card-bg: #FFFFFF;
    --dsp-border: #E2E8F0;
    --dsp-text: #1E293B;
    --dsp-text-secondary: #64748B;
    --dsp-text-muted: #94A3B8;
    --dsp-error: #EF4444;
    --dsp-error-bg: #FEF2F2;
    --dsp-success: #10B981;
    --dsp-success-bg: #F0FDF4;
    --dsp-radius: 12px;
    --dsp-radius-sm: 8px;
    --dsp-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --dsp-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --dsp-bg: #0F172A;
        --dsp-card-bg: #1E293B;
        --dsp-border: #334155;
        --dsp-text: #F1F5F9;
        --dsp-text-secondary: #94A3B8;
        --dsp-text-muted: #64748B;
        --dsp-primary-light: #1E1B4B;
        --dsp-error-bg: #450A0A;
        --dsp-success-bg: #052E16;
    }
}

.dsp-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dsp-text);
}

/* ═══ TABS ═══ */

.dsp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--dsp-bg);
    padding: 4px;
    border-radius: var(--dsp-radius);
    border: 1px solid var(--dsp-border);
}

.dsp-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--dsp-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--dsp-radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dsp-tab:hover {
    color: var(--dsp-text);
    background: var(--dsp-card-bg);
}

.dsp-tab--active {
    background: var(--dsp-card-bg);
    color: var(--dsp-primary);
    box-shadow: var(--dsp-shadow);
}

.dsp-tab-icon {
    font-size: 18px;
}

.dsp-panel {
    display: none;
}

.dsp-panel--active {
    display: block;
}

/* ═══ GENERATOR ═══ */

.dsp-generator {
    background: var(--dsp-card-bg);
    border-radius: var(--dsp-radius);
    border: 1px solid var(--dsp-border);
    padding: 32px;
    box-shadow: var(--dsp-shadow);
}

.dsp-generator__header {
    text-align: center;
    margin-bottom: 28px;
}

.dsp-generator__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--dsp-text);
}

.dsp-generator__subtitle {
    color: var(--dsp-text-secondary);
    font-size: 15px;
    margin: 0;
    line-height: 1.5;
}

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

.dsp-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--dsp-border);
    border-radius: var(--dsp-radius-sm);
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
    background: var(--dsp-bg);
    color: var(--dsp-text);
    font-family: inherit;
    box-sizing: border-box;
}

.dsp-textarea:focus {
    outline: none;
    border-color: var(--dsp-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

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

.dsp-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--dsp-border);
    border-radius: var(--dsp-radius-sm);
    font-size: 14px;
    background: var(--dsp-bg);
    color: var(--dsp-text);
    cursor: pointer;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    appearance: auto;
}

.dsp-select:focus {
    outline: none;
    border-color: var(--dsp-primary);
}

.dsp-options-row {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}

.dsp-input-group {
    margin-bottom: 16px;
}

.dsp-input-group--half {
    flex: 1;
    margin-bottom: 0;
}

/* ═══ BUTTONS ═══ */

.dsp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--dsp-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
}

.dsp-btn--primary {
    background: var(--dsp-primary);
    color: #FFF;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
}

.dsp-btn--primary:hover {
    background: var(--dsp-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

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

.dsp-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dsp-btn--secondary {
    background: var(--dsp-bg);
    color: var(--dsp-primary);
    border: 1px solid var(--dsp-border);
}

.dsp-btn--secondary:hover {
    background: var(--dsp-primary-light);
}

.dsp-btn--sm {
    padding: 7px 14px;
    font-size: 13px;
}

.dsp-btn--copy {
    background: var(--dsp-accent);
    color: #FFF;
}

.dsp-btn--copy:hover {
    background: var(--dsp-accent-hover);
}

.dsp-btn--ghost {
    background: transparent;
    color: var(--dsp-text-secondary);
    border: 1px solid var(--dsp-border);
}

.dsp-btn--ghost:hover {
    background: var(--dsp-bg);
    color: var(--dsp-text);
}

/* Spinner */
.dsp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #FFF;
    border-radius: 50%;
    animation: dsp-spin 0.6s linear infinite;
}

@keyframes dsp-spin {
    to { transform: rotate(360deg); }
}

/* ═══ RESULT ═══ */

.dsp-result {
    margin-top: 24px;
    background: var(--dsp-success-bg);
    border: 1px solid var(--dsp-accent);
    border-radius: var(--dsp-radius);
    overflow: hidden;
}

.dsp-result__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.dsp-result__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--dsp-text);
}

.dsp-result__content {
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--dsp-text);
    max-height: 500px;
    overflow-y: auto;
}

/* ═══ ERROR ═══ */

.dsp-error {
    margin-top: 16px;
    padding: 14px 20px;
    background: var(--dsp-error-bg);
    border: 1px solid var(--dsp-error);
    border-radius: var(--dsp-radius-sm);
    color: var(--dsp-error);
    font-size: 14px;
    font-weight: 500;
}

/* ═══ LIBRARY ═══ */

.dsp-library__search {
    margin-bottom: 16px;
}

.dsp-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid var(--dsp-border);
    border-radius: var(--dsp-radius-sm);
    font-size: 15px;
    background: var(--dsp-card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%2394A3B8' viewBox='0 0 24 24'%3E%3Cpath d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z' stroke='%2394A3B8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") 14px center no-repeat;
    color: var(--dsp-text);
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.dsp-search-input:focus {
    outline: none;
    border-color: var(--dsp-primary);
}

/* Category buttons */
.dsp-library__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.dsp-cat-btn {
    padding: 8px 16px;
    border: 1px solid var(--dsp-border);
    background: var(--dsp-card-bg);
    color: var(--dsp-text-secondary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.dsp-cat-btn:hover {
    border-color: var(--dsp-primary);
    color: var(--dsp-primary);
}

.dsp-cat-btn--active {
    background: var(--dsp-primary);
    color: #FFF;
    border-color: var(--dsp-primary);
}

/* Card grid */
.dsp-library__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.dsp-card {
    background: var(--dsp-card-bg);
    border: 1px solid var(--dsp-border);
    border-radius: var(--dsp-radius);
    padding: 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.dsp-card:hover {
    box-shadow: var(--dsp-shadow-lg);
    border-color: var(--dsp-primary);
    transform: translateY(-2px);
}

.dsp-card--hidden {
    display: none !important;
}

.dsp-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.dsp-card__icon {
    font-size: 20px;
}

.dsp-card__category {
    font-size: 12px;
    color: var(--dsp-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dsp-card__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--dsp-text);
}

.dsp-card__preview {
    font-size: 13px;
    color: var(--dsp-text-secondary);
    line-height: 1.5;
    margin: 0 0 16px;
    flex-grow: 1;
}

.dsp-card__actions {
    display: flex;
    gap: 8px;
}

/* No results */
.dsp-no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--dsp-text-muted);
    font-size: 16px;
}

/* ═══ MODAL ═══ */

.dsp-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dsp-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.dsp-modal__content {
    position: relative;
    background: var(--dsp-card-bg);
    border-radius: var(--dsp-radius);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.dsp-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--dsp-border);
}

.dsp-modal__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.dsp-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--dsp-bg);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--dsp-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dsp-modal__close:hover {
    background: var(--dsp-error-bg);
    color: var(--dsp-error);
}

.dsp-modal__body {
    padding: 24px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--dsp-text);
}

.dsp-modal__footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--dsp-border);
}

.dsp-modal__footer .dsp-btn {
    flex: 1;
}

/* ═══ TOAST ═══ */

.dsp-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1E293B;
    color: #FFF;
    padding: 12px 24px;
    border-radius: var(--dsp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999999;
    transition: transform 0.3s ease;
    box-shadow: var(--dsp-shadow-lg);
}

.dsp-toast--visible {
    transform: translateX(-50%) translateY(0);
}

/* ═══ RESPONSIVE ═══ */

@media (max-width: 768px) {
    .dsp-generator {
        padding: 20px 16px;
    }

    .dsp-generator__title {
        font-size: 20px;
    }

    .dsp-options-row {
        flex-direction: column;
        gap: 0;
    }

    .dsp-input-group--half {
        margin-bottom: 16px;
    }

    .dsp-library__grid {
        grid-template-columns: 1fr;
    }

    .dsp-library__categories {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .dsp-tabs {
        flex-direction: column;
    }

    .dsp-modal__content {
        max-height: 90vh;
    }

    .dsp-modal__footer {
        flex-direction: column;
    }
}
