/* AI Page Specific Styles */

.page-header {
    position: relative;
    padding: 60px 20px 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    z-index: 10;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-container {
    max-width: 1000px;
    padding-top: 30px;
}

/* Controls */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(167, 139, 250, 0.15);
    border-color: #a78bfa;
    color: #a78bfa;
}

.btn-primary {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-link {
    display: inline-block;
    margin-top: 20px;
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s;
    width: 100%;
}

.btn-link:hover {
    background: rgba(96, 165, 250, 0.25);
    text-decoration: none;
}

/* AI Grid - Small Cards */
.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
}

.ai-item-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ai-item-card:hover {
    transform: translateY(-5px);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: rgba(30, 41, 59, 0.8);
}

.ai-item-logo {
    font-size: 2.8rem;
    margin-bottom: 12px;
    line-height: 1;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
    z-index: 1;
}

.ai-item-preview {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 260px;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 100;
    text-align: left;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.ai-item-preview::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 9px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.ai-item-card:hover .ai-item-preview {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.preview-category {
    font-size: 0.75rem;
    color: #a78bfa;
    margin-bottom: 8px;
    font-weight: 600;
    display: inline-block;
}

.preview-desc {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    padding: 30px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}

/* View Modal Specifics */
.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.modal-logo {
    font-size: 4rem;
    margin-bottom: 15px;
    line-height: 1;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    text-align: center;
}

.badge {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 1rem;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #60a5fa;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
}

/* Specific to Logo Drop Zone */
.drop-zone {
    border: 2px dashed rgba(148, 163, 184, 0.4);
    border-radius: 8px;
    padding: 20px 10px;
    text-align: center;
    margin-bottom: 12px;
    background: rgba(15, 23, 42, 0.4);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
}

.drop-zone.dragover {
    background: rgba(96, 165, 250, 0.15);
    border-color: #60a5fa;
}

.drop-zone-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
    line-height: 1.4;
}

.logo-preview {
    font-size: 2.2rem;
    margin-bottom: 8px;
    line-height: 1;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .ai-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
}

/* Prompt Section Styles */
.section-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 60px 0;
}

.prompt-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.prompt-controls {
    align-items: center;
}

.search-sort-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.search-input, .sort-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.search-input {
    min-width: 200px;
    flex: 1;
}

.search-input:focus, .sort-select:focus {
    border-color: #fcd34d;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.prompt-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.prompt-card:hover {
    transform: translateY(-5px);
    border-color: rgba(252, 211, 77, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: rgba(30, 41, 59, 0.8);
}

.prompt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.prompt-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-right: 10px;
}

.prompt-card-category {
    font-size: 0.75rem;
    color: #fcd34d;
    background: rgba(252, 211, 77, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.prompt-card-ai {
    font-size: 0.75rem;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.prompt-card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prompt-view-content {
    max-width: 650px;
    width: 95%;
}

.prompt-desc-text {
    margin-bottom: 20px;
    font-size: 1.05rem;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
}

.prompt-code-block {
    position: relative;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.prompt-code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.6;
    max-height: 350px;
    overflow-y: auto;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #fcd34d;
    color: #000;
    border-color: #fcd34d;
}

.copy-btn.copied {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}
