/* AI Prompts Library - WordPress Plugin Styles */

/* CSS Variables */
:root {
    --ai-bg: #ffffff;
    --ai-fg: #171717;
    --ai-card: #ffffff;
    --ai-card-fg: #171717;
    --ai-primary: #171717;
    --ai-primary-fg: #fafafa;
    --ai-secondary: #f5f5f5;
    --ai-secondary-fg: #171717;
    --ai-muted: #f5f5f5;
    --ai-muted-fg: #737373;
    --ai-border: #e5e5e5;
    --ai-radius: 0.625rem;
}

/* Reset for plugin container */
.ai-prompts-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Layout */
.ai-prompts-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, var(--ai-bg), rgba(245, 245, 245, 0.3));
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

/* Header */
.ai-prompts-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--ai-border);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
}

.ai-prompts-header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ai-prompts-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-prompts-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #8b5cf6, #f43f5e);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
}

.ai-prompts-logo-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.ai-prompts-logo-icon::after {
    content: '';
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid var(--ai-bg);
    animation: aiPulse 2s infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-prompts-logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.ai-prompts-logo-text p {
    font-size: 0.75rem;
    color: var(--ai-muted-fg);
}

.ai-prompts-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Search */
.ai-prompts-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
}

.ai-prompts-search-wrapper svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--ai-muted-fg);
}

.ai-prompts-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 0;
    border-radius: var(--ai-radius);
    background: rgba(245, 245, 245, 0.5);
    font-size: 0.875rem;
    outline: none;
    font-family: inherit;
}

.ai-prompts-search-input:focus {
    box-shadow: 0 0 0 1px var(--ai-primary);
}

/* Button */
.ai-prompts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--ai-bg);
    color: var(--ai-fg);
    font-family: inherit;
}

.ai-prompts-btn:hover {
    background: var(--ai-secondary);
}

.ai-prompts-btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #f43f5e);
    border: 0;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-prompts-btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #e11d48);
}

.ai-prompts-btn-icon {
    padding: 0.5rem;
    width: 2rem;
    height: 2rem;
}

.ai-prompts-btn-ghost {
    background: transparent;
    border: 0;
}

.ai-prompts-btn-ghost:hover {
    background: var(--ai-secondary);
}

/* Hero */
.ai-prompts-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--ai-border);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), var(--ai-bg), rgba(244, 63, 94, 0.05));
}

.ai-prompts-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(139, 92, 246, 0.1), transparent);
}

.ai-prompts-hero-content {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1rem;
    text-align: center;
}

.ai-prompts-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 9999px;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    margin-bottom: 1rem;
}

.ai-prompts-hero h2 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

.ai-prompts-hero p {
    font-size: 1.125rem;
    color: var(--ai-muted-fg);
    max-width: 42rem;
    margin: 0 auto 1rem;
}

.ai-prompts-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--ai-muted-fg);
}

.ai-prompts-hero-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-prompts-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #10b981;
}

.ai-prompts-dot-violet {
    background: #8b5cf6;
}

/* Main */
.ai-prompts-main {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

/* Tabs */
.ai-prompts-tabs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.ai-prompts-tabs-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 28rem;
    margin: 0 auto;
    background: var(--ai-secondary);
    border-radius: var(--ai-radius);
    padding: 0.25rem;
}

.ai-prompts-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 0;
    background: transparent;
    border-radius: calc(var(--ai-radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--ai-muted-fg);
    font-family: inherit;
}

.ai-prompts-tab-btn:hover {
    color: var(--ai-fg);
}

.ai-prompts-tab-btn.active {
    background: var(--ai-bg);
    color: var(--ai-fg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Category Pills */
.ai-prompts-category-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ai-prompts-category-pill {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--ai-bg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.ai-prompts-category-pill:hover {
    background: var(--ai-secondary);
}

.ai-prompts-category-pill.active {
    background: linear-gradient(135deg, #8b5cf6, #f43f5e);
    border-color: transparent;
    color: white;
}

/* Grid */
.ai-prompts-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .ai-prompts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .ai-prompts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card */
.ai-prompts-card {
    position: relative;
    border: 1px solid rgba(229, 229, 229, 0.5);
    border-radius: var(--ai-radius);
    background: var(--ai-card);
    overflow: hidden;
    transition: all 0.3s;
}

.ai-prompts-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.3);
}

.ai-prompts-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(244, 63, 94, 0.1));
    border-bottom-left-radius: 100%;
    opacity: 0;
    transition: opacity 0.3s;
}

.ai-prompts-card:hover::before {
    opacity: 1;
}

.ai-prompts-card-header {
    padding: 1rem 1rem 0.75rem;
}

.ai-prompts-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: calc(var(--ai-radius) - 2px);
    margin-bottom: 0.5rem;
}

.ai-prompts-badge-writing { background: rgba(244, 63, 94, 0.1); color: #e11d48; }
.ai-prompts-badge-coding { background: rgba(16, 185, 129, 0.1); color: #059669; }
.ai-prompts-badge-business { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.ai-prompts-badge-education { background: rgba(14, 165, 233, 0.1); color: #0284c7; }
.ai-prompts-badge-creative { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.ai-prompts-badge-chat { background: rgba(6, 182, 212, 0.1); color: #0891b2; }

.ai-prompts-card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.ai-prompts-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
}

.ai-prompts-card-description {
    font-size: 0.875rem;
    color: var(--ai-muted-fg);
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-prompts-card-content {
    padding: 0 1rem 1rem;
}

.ai-prompts-prompt-preview {
    background: rgba(245, 245, 245, 0.5);
    border-radius: calc(var(--ai-radius) - 2px);
    padding: 0.75rem;
    position: relative;
    margin-bottom: 1rem;
}

.ai-prompts-prompt-preview p {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--ai-muted-fg);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 2rem;
}

.ai-prompts-copy-btn {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0.25rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--ai-muted-fg);
}

.ai-prompts-prompt-preview:hover .ai-prompts-copy-btn {
    opacity: 1;
}

.ai-prompts-copy-btn.copied svg {
    color: #10b981;
}

/* Tags */
.ai-prompts-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.ai-prompts-tag {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    border-radius: calc(var(--ai-radius) - 2px);
    background: var(--ai-secondary);
    color: var(--ai-muted-fg);
}

/* Card Footer */
.ai-prompts-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ai-border);
    font-size: 0.75rem;
    color: var(--ai-muted-fg);
}

.ai-prompts-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-prompts-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ai-prompts-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Heart */
.ai-prompts-heart-btn {
    color: var(--ai-muted-fg);
    transition: color 0.15s;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0.25rem;
}

.ai-prompts-heart-btn:hover {
    color: #f43f5e;
}

.ai-prompts-heart-btn.favorited {
    color: #f43f5e;
}

.ai-prompts-heart-btn.favorited svg {
    fill: #f43f5e;
}

/* Empty State */
.ai-prompts-empty-state {
    text-align: center;
    padding: 4rem 1rem;
    grid-column: 1 / -1;
}

.ai-prompts-empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: var(--ai-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-prompts-empty-icon svg {
    width: 2rem;
    height: 2rem;
    color: var(--ai-muted-fg);
}

.ai-prompts-empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ai-prompts-empty-state p {
    color: var(--ai-muted-fg);
    margin-bottom: 1rem;
}

/* Modal */
.ai-prompts-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.ai-prompts-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ai-prompts-modal {
    background: var(--ai-card);
    border-radius: var(--ai-radius);
    width: 100%;
    max-width: 34rem;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.ai-prompts-modal-overlay.active .ai-prompts-modal {
    transform: scale(1);
}

.ai-prompts-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--ai-border);
    position: relative;
}

.ai-prompts-modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ai-prompts-modal-header p {
    font-size: 0.875rem;
    color: var(--ai-muted-fg);
}

.ai-prompts-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--ai-muted-fg);
    padding: 0.25rem;
}

.ai-prompts-close-btn:hover {
    color: var(--ai-fg);
}

.ai-prompts-modal-body {
    padding: 1.5rem;
}

.ai-prompts-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--ai-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Form */
.ai-prompts-form-group {
    margin-bottom: 1rem;
}

.ai-prompts-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.ai-prompts-form-input,
.ai-prompts-form-select,
.ai-prompts-form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
}

.ai-prompts-form-input:focus,
.ai-prompts-form-select:focus,
.ai-prompts-form-textarea:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
}

.ai-prompts-form-textarea {
    min-height: 150px;
    font-family: monospace;
    resize: vertical;
}

/* Footer */
.ai-prompts-footer {
    border-top: 1px solid var(--ai-border);
    background: rgba(245, 245, 245, 0.3);
    padding: 1.5rem 1rem;
    margin-top: auto;
}

.ai-prompts-footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .ai-prompts-footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.ai-prompts-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-prompts-footer-brand-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #8b5cf6, #f43f5e);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-prompts-footer-brand-icon svg {
    width: 1rem;
    height: 1rem;
    color: white;
}

.ai-prompts-footer-text {
    font-size: 0.875rem;
    color: var(--ai-muted-fg);
    text-align: center;
}

.ai-prompts-footer-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--ai-muted-fg);
}

/* Toast */
.ai-prompts-toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 200;
}

.ai-prompts-toast {
    padding: 0.75rem 1rem;
    background: var(--ai-fg);
    color: var(--ai-bg);
    border-radius: var(--ai-radius);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    animation: aiSlideIn 0.3s ease-out;
}

@keyframes aiSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading */
.ai-prompts-loading {
    text-align: center;
    padding: 3rem;
    color: var(--ai-muted-fg);
}

/* Hide on mobile */
@media (max-width: 639px) {
    .ai-prompts-hide-mobile {
        display: none;
    }
}
