/**
 * Epic Prompts Core - Plugin Styles
 * Base styles for the Epic Prompts plugin
 */

/* ========================================
   CSS VARIABLES
   ======================================== */

:root {
    --primary: #6366F1;
    --secondary: #EC4899;
    --accent: #10B981;
    --warning: #F59E0B;
    --text: #111827;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --background: #F9FAFB;
    --white: #FFFFFF;
}

/* ========================================
   REACTION BUTTONS
   ======================================== */

.reactions-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 9999px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    color: var(--text);
}

.reaction-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reaction-btn:active:not(:disabled) {
    transform: translateY(0);
}

.reaction-btn.active {
    background: #EEF2FF;
    border-color: var(--primary);
}

.reaction-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reaction-emoji {
    font-size: 1.25rem;
    line-height: 1;
}

.reaction-count {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-light);
}

.reaction-btn.active .reaction-count {
    color: var(--primary);
}

.reaction-success {
    animation: reactionPulse 0.6s ease;
}

@keyframes reactionPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========================================
   VERIFICATION BADGE
   ======================================== */

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #D1FAE5;
    color: #065F46;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.verified-badge .icon {
    font-size: 1rem;
}

/* ========================================
   RATING STARS
   ======================================== */

.rating-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    display: flex;
    gap: 0.125rem;
}

.star {
    color: #D1D5DB;
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star.filled {
    color: #F59E0B;
}

.star:hover,
.star.hover {
    color: #FBBF24;
}

.rating-average {
    font-weight: 600;
    color: var(--text);
}

.rating-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ========================================
   PROMPT SUBMISSION FORM
   ======================================== */

.prompt-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-label.required::after {
    content: '*';
    color: #EF4444;
    margin-left: 0.25rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', monospace;
}

.form-help {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.form-error {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* File Upload Styling */
.file-upload-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-label:hover {
    border-color: var(--primary);
    background: #F9FAFB;
}

.file-preview {
    margin-top: 1rem;
    max-width: 300px;
}

.file-preview img {
    width: 100%;
    border-radius: 0.5rem;
    border: 2px solid var(--border);
}

/* ========================================
   USER XP & LEVEL DISPLAY
   ======================================== */

.user-xp-bar {
    background: #E5E7EB;
    height: 8px;
    border-radius: 9999px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.user-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
}

.xp-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ========================================
   COPY BUTTON
   ======================================== */

.copy-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: var(--text);
}

.copy-prompt-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.copy-prompt-btn.copied {
    background: var(--accent) !important;
    color: var(--white) !important;
    border-color: var(--accent) !important;
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

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

.toast-notification.success {
    border-left: 4px solid var(--accent);
}

.toast-notification.error {
    border-left: 4px solid #EF4444;
}

.toast-notification.info {
    border-left: 4px solid var(--primary);
}

/* ========================================
   MOBILE MENU
   ======================================== */

.mobile-menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
    }

    .mobile-menu.open {
        right: 0;
    }
}

/* ========================================
   HEADER ANIMATIONS
   ======================================== */

.site-header {
    transition: transform 0.3s ease;
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--white);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .reactions-container,
    .copy-prompt-btn,
    .mobile-menu-toggle,
    .toast-notification {
        display: none !important;
    }
}
