/**
 * Frontend styles for Digital Haider Prompts
 *
 * @package Digital_Haider_Prompts
 */

:root {
    --primary: #3b82f6;
    --accent: #fbbf24;
    --gradient-start: #3b82f6;
    --gradient-end: #1d4ed8;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-text: #e2e8f0;
}

[data-theme="purple"] {
    --primary: #8b5cf6;
    --accent: #d946ef;
    --gradient-start: #8b5cf6;
    --gradient-end: #6d28d9;
}

[data-theme="green"] {
    --primary: #10b981;
    --accent: #34d399;
    --gradient-start: #10b981;
    --gradient-end: #059669;
}

[data-theme="orange"] {
    --primary: #f97316;
    --accent: #fb923c;
    --gradient-start: #f97316;
    --gradient-end: #ea580c;
}

[data-theme="minimal"] {
    --primary: #64748b;
    --accent: #94a3b8;
    --gradient-start: #64748b;
    --gradient-end: #475569;
}

* {
    font-family: 'Poppins', sans-serif;
}

.dhp-container {
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
.dark .dhp-container {
    background: var(--dark-bg);
    color: var(--dark-text);
}

.dark .bg-white {
    background: var(--dark-card) !important;
}

.dark .text-gray-800 {
    color: var(--dark-text) !important;
}

.dark .text-gray-600 {
    color: #94a3b8 !important;
}

.dark .border-gray-200 {
    border-color: #334155 !important;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.modal-enter {
    animation: modalEnter 0.3s ease-out;
}

/* Hover Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
}

/* Category Colors */
.category-business { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.category-creative-writing { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.category-marketing { background: linear-gradient(135deg, #10b981, #059669); }
.category-programming { background: linear-gradient(135deg, #f59e0b, #d97706); }
.category-education { background: linear-gradient(135deg, #ec4899, #db2777); }
.category-productivity { background: linear-gradient(135deg, #06b6d4, #0891b2); }

/* Difficulty Badges */
.difficulty-easy { 
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.difficulty-medium { 
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.difficulty-hard { 
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
}

/* Scroll Progress Bar */
.dhp-scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary);
    z-index: 9999;
    transition: width 0.1s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-end);
}

.dark ::-webkit-scrollbar-track {
    background: var(--dark-card);
}

/* Hero Section */
.dhp-hero {
    position: relative;
    color: white;
    overflow: hidden;
    padding: 5rem 2rem;
    text-align: center;
}

.dhp-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
}

.dhp-hero-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.dhp-hero-icon {
    margin-bottom: 1.5rem;
}

.dhp-hero-icon i {
    font-size: 4rem;
    opacity: 0.9;
}

.dhp-hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.dhp-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.dhp-hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.dhp-stat-badge {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.dark .glass {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Floating Icons */
.dhp-floating-icon {
    position: absolute;
    opacity: 0.2;
    font-size: 2.5rem;
    display: none;
}

.dhp-float-1 {
    top: 2.5rem;
    left: 2.5rem;
    animation: float 6s ease-in-out 0.5s infinite;
}

.dhp-float-2 {
    top: 5rem;
    right: 5rem;
    animation: float 6s ease-in-out 1s infinite;
}

.dhp-float-3 {
    bottom: 2.5rem;
    left: 25%;
    animation: float 6s ease-in-out 1.5s infinite;
}

@media (min-width: 768px) {
    .dhp-floating-icon {
        display: block;
    }
}

/* Filters Section */
.dhp-filters-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.dhp-filters-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.dark .dhp-filters-container {
    background: var(--dark-card);
}

.dhp-search-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.dhp-search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    font-size: 1rem;
    border-radius: 1rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.dark .dhp-search-input {
    background: var(--dark-bg);
    border-color: #374151;
    color: var(--dark-text);
}

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

.dhp-search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.125rem;
}

.dhp-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dhp-select {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: white;
    font-size: 0.875rem;
    transition: all 0.3s;
    cursor: pointer;
}

.dark .dhp-select {
    background: var(--dark-bg);
    border-color: #374151;
    color: var(--dark-text);
}

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

.dhp-utility-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dhp-result-info {
    font-size: 0.875rem;
    color: #64748b;
}

.dark .dhp-result-info {
    color: #94a3b8;
}

.dhp-result-count {
    font-weight: 600;
    color: #1e293b;
}

.dark .dhp-result-count {
    color: white;
}

.dhp-utility-buttons {
    display: flex;
    gap: 0.5rem;
}

.dhp-btn-utility {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.dark .dhp-btn-utility {
    background: #374151;
    color: var(--dark-text);
}

.dhp-btn-utility:hover {
    background: #e2e8f0;
}

.dark .dhp-btn-utility:hover {
    background: #4b5563;
}

.focus-ring:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Prompts Section */
.dhp-prompts-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

/* Grid Layouts */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.list-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.masonry-layout {
    column-count: 3;
    column-gap: 1.5rem;
}

.masonry-layout > * {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .masonry-layout {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .masonry-layout {
        column-count: 1;
    }
    
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Prompt Cards */
.dhp-prompt-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.dark .dhp-prompt-card {
    background: var(--dark-card);
}

.dhp-prompt-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.dhp-card-header-bar {
    height: 4px;
    width: 100%;
}

.dhp-card-content {
    padding: 1.5rem;
}

.dhp-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dhp-card-icon {
    font-size: 1.875rem;
    opacity: 0.8;
}

.dhp-card-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.dhp-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.dark .dhp-card-title {
    color: white;
}

.dhp-card-description {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .dhp-card-description {
    color: #94a3b8;
}

.dhp-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dhp-card-tag {
    padding: 0.25rem 0.5rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
}

.dark .dhp-card-tag {
    background: #374151;
    color: #94a3b8;
}

.dhp-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dhp-card-usage {
    font-size: 0.875rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dark .dhp-card-usage {
    color: #94a3b8;
}

.dhp-card-button {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.dhp-card-button:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* List View Specific */
.dhp-list-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem;
}

.dhp-list-icon {
    font-size: 2.5rem;
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    color: white;
}

.dhp-list-content {
    flex: 1;
}

/* No Results */
.dhp-no-results {
    text-align: center;
    padding: 4rem 1rem;
}

.dhp-no-results i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.dark .dhp-no-results i {
    color: #4b5563;
}

.dhp-no-results h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.dark .dhp-no-results h3 {
    color: #94a3b8;
}

.dhp-no-results p {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.dhp-btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.dhp-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Floating Action Button */
.dhp-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dhp-fab:hover {
    transform: scale(1.1);
}

/* Toast Notifications */
.dhp-toast-container {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dhp-toast {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dhp-toast-success {
    background: #10b981;
}

.dhp-toast-error {
    background: #ef4444;
}

.dhp-toast-info {
    background: #3b82f6;
}

/* Modal */
.dhp-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.dhp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.dhp-modal-wrapper {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.dhp-modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    max-width: 56rem;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.dark .dhp-modal-content {
    background: var(--dark-card);
}

.dhp-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dark .dhp-modal-header {
    border-bottom-color: #374151;
}

.dhp-modal-header-content {
    flex: 1;
}

.dhp-modal-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.dark .dhp-modal-title {
    color: white;
}

.dhp-modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dhp-modal-badge {
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

.dhp-modal-badge-gray {
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background: #f1f5f9;
    color: #64748b;
}

.dark .dhp-modal-badge-gray {
    background: #374151;
    color: #94a3b8;
}

.dhp-modal-close {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 1rem;
}

.dhp-modal-close:hover {
    background: #f1f5f9;
}

.dark .dhp-modal-close:hover {
    background: #374151;
}

.dhp-modal-close i {
    font-size: 1.25rem;
    color: #64748b;
}

.dark .dhp-modal-close i {
    color: #94a3b8;
}

.dhp-modal-body {
    padding: 1.5rem;
    max-height: 24rem;
    overflow-y: auto;
}

.dhp-modal-section {
    margin-bottom: 1.5rem;
}

.dhp-modal-section:last-child {
    margin-bottom: 0;
}

.dhp-modal-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.dark .dhp-modal-section-title {
    color: white;
}

.dhp-modal-section-content {
    color: #64748b;
}

.dark .dhp-modal-section-content {
    color: #94a3b8;
}

.dhp-modal-code {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #1e293b;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.dark .dhp-modal-code {
    background: var(--dark-bg);
    border-color: #374151;
    color: #e5e7eb;
}

.dhp-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dhp-modal-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dhp-modal-list i {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.dhp-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dhp-modal-tag {
    padding: 0.5rem 0.75rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.dark .dhp-modal-tag {
    background: #374151;
    color: #94a3b8;
}

.dhp-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-radius: 0 0 1rem 1rem;
}

.dark .dhp-modal-footer {
    background: var(--dark-bg);
    border-top-color: #374151;
}

.dhp-btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #64748b;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.dark .dhp-btn-secondary {
    border-color: #4b5563;
    color: #94a3b8;
}

.dhp-btn-secondary:hover {
    background: #f1f5f9;
}

.dark .dhp-btn-secondary:hover {
    background: #374151;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-yellow-300 {
    color: #fcd34d;
}

.text-white {
    color: white;
}

/* Responsive */
@media (max-width: 640px) {
    .dhp-hero {
        padding: 3rem 1rem;
    }

    .dhp-filters-grid {
        grid-template-columns: 1fr;
    }

    .dhp-modal-content {
        margin: 1rem;
    }

    .dhp-modal-title {
        font-size: 1.5rem;
    }
}
