* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f172a;
    overflow-x: hidden;
    color: #f8fafc;
    width: 100%;
}

.app-container {
    display: flex;
    height: 100vh;
    background: #0f172a;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 320px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.logo i {
    font-size: 28px;
    color: #8b5cf6;
}

.logo span {
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-tag {
    font-size: 10px;
    font-weight: 600;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 1px 7px;
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
}

body.light-theme .version-tag {
    color: #6b21a8;
    background: #f3e8ff;
    border: 1px solid #d8b4fe;
}

.add-prompt-btn {
    width: 100%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.add-prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.action-btn {
    cursor: pointer;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn.secondary-btn {
    flex: 1;
    justify-content: center;
    font-size: 13px;
    color: #94a3b8;
}

.action-btn.secondary-btn:hover {
    color: #cbd5e1;
}

.stats {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-card i {
    font-size: 24px;
    color: #8b5cf6;
}

.stat-card h3 {
    font-size: 20px;
    font-weight: 700;
}

.stat-card p {
    font-size: 12px;
    opacity: 0.7;
}

.search-section {
    padding: 0 20px 20px 20px;
}

.search-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box i {
    color: #8b5cf6;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.categories-section {
    flex: 1;
    padding: 0 20px;
    overflow-y: auto;
}

.categories-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(109, 40, 217, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.category-item > * {
    position: relative;
    z-index: 1;
}

.category-item i {
    width: 20px;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-item:hover {
    color: #ffffff;
    transform: scale(1.02) translateX(4px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
}

.category-item:hover::before {
    opacity: 1;
}

.category-item:hover i {
    transform: scale(1.15) rotate(5deg);
    color: #c4b5fd;
}

.category-item.active {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.category-item.active .category-count {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.category-item i {
    width: 20px;
    font-size: 16px;
}

.category-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    opacity: 0.6;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    box-sizing: border-box;
    width: 100%;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #f8fafc;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-options {
    display: flex;
    gap: 8px;
}

.view-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #94a3b8;
}

.view-btn.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

/* Prompts Grid */
.prompts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.prompts-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prompt-card {
    background: #1e293b;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.prompt-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.list-view .prompt-card {
    display: flex;
}

.list-view .prompt-image {
    width: 120px;
    height: 120px;
}

.prompt-content {
    padding: 20px;
}

.prompt-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f8fafc;
}

.prompt-text {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prompt-category {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.prompt-actions {
    display: flex;
    gap: 8px;
}

.prompt-actions button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #94a3b8;
}

.prompt-actions button:hover {
    background: #8b5cf6;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1e293b;
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUpFade 0.25s ease-out;
    color: #f8fafc;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e293b;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.modal-header h2 {
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
}

.modal-header h2 i {
    color: #8b5cf6;
}

.close-modal, .close-delete-modal, .close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s ease;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close-modal:hover, .close-delete-modal:hover, .close-modal-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #1e293b;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

/* ─── Edit Prompt Modal Specifics ─────────────────────────────────────────── */
.edit-prompt-modal-content {
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edit-prompt-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.edit-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.edit-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.form-group {
    margin-bottom: 20px;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #e2e8f0;
}

.form-group label i {
    color: #8b5cf6;
    font-size: 14px;
}

.label-optional {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
    margin-left: 4px;
}

.input-char-counter {
    font-size: 11.5px;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: white;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.form-group textarea {
    min-height: 200px;
    line-height: 1.6;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #64748b;
}

.form-group select option {
    background: #1e293b;
    color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.category-select-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-select-wrapper select {
    flex: 1;
}

.add-category-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    padding: 0 16px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.add-category-btn:hover {
    background: #8b5cf6;
    color: #ffffff;
    border-color: #8b5cf6;
}

/* Image Upload Area */
.image-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(15, 23, 42, 0.3);
}

.image-upload-area:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.upload-placeholder {
    padding: 16px 10px;
}

.upload-placeholder i {
    font-size: 38px;
    color: #8b5cf6;
    margin-bottom: 8px;
    display: inline-block;
}

.upload-title {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.upload-subtitle {
    font-size: 12px;
    color: #64748b;
}

/* Compact Image Preview Card */
.image-preview-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    text-align: left;
}

.image-preview-thumb-wrap {
    width: 80px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.image-preview-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.preview-status-tag {
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-preview-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.change-image-btn, .remove-image-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.change-image-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
}

.change-image-btn:hover {
    background: #8b5cf6;
    color: #ffffff;
}

.remove-image-btn {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.remove-image-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

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

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* ─── View Prompt Modal ───────────────────────────────────────────────────── */
.view-prompt-modal-content {
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
}

.view-prompt-header {
    padding: 22px 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background: #1e293b;
    position: sticky;
    top: 0;
    z-index: 10;
}

.view-prompt-header-main {
    flex: 1;
    min-width: 0;
}

.view-prompt-title-row h2 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    word-break: break-word;
}

.view-prompt-title-row h2 i {
    color: #a78bfa;
    font-size: 18px;
    flex-shrink: 0;
}

.view-prompt-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.view-prompt-badge {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.view-prompt-badge i {
    font-size: 11px;
}

.view-prompt-meta-item {
    font-size: 12px;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.view-prompt-meta-item i {
    color: #8b5cf6;
    font-size: 11px;
}

.view-prompt-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.view-copy-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.view-copy-btn:hover {
    background: #8b5cf6;
    color: #ffffff;
    border-color: #8b5cf6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.view-copy-btn.copied {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.view-prompt-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 26px;
}

.view-prompt-image-container {
    width: 100%;
    max-height: 240px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-prompt-image {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    background: #0f172a;
    display: block;
}

.view-prompt-content-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 22px;
}

.view-prompt-content-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-prompt-content-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a78bfa;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ─── Markdown Prompt Typography ─────────────────────────────────────────── */
.prompt-markdown-body {
    font-size: 15px;
    line-height: 1.75;
    color: #cbd5e1;
    word-break: break-word;
}

.prompt-md-p {
    margin-bottom: 14px;
    margin-top: 0;
}

.prompt-md-p:last-child {
    margin-bottom: 0;
}

.prompt-md-h {
    color: #f8fafc;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.prompt-md-h:first-child {
    margin-top: 0;
}

.prompt-md-h1 {
    font-size: 18px;
    color: #a78bfa;
    border-left: 3px solid #8b5cf6;
    padding-left: 10px;
}

.prompt-md-h2 {
    font-size: 16px;
    color: #c4b5fd;
    border-left: 3px solid #7c3aed;
    padding-left: 8px;
}

.prompt-md-h3 {
    font-size: 15px;
    color: #e2e8f0;
    font-weight: 600;
}

.prompt-md-h4 {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 600;
}

.prompt-md-ul, .prompt-md-ol {
    margin: 10px 0 16px 20px;
    padding-left: 4px;
}

.prompt-md-ul li, .prompt-md-ol li {
    margin-bottom: 6px;
    line-height: 1.65;
    color: #cbd5e1;
}

.prompt-md-bold {
    color: #ffffff;
    font-weight: 700;
}

.prompt-md-italic {
    font-style: italic;
    color: #e2e8f0;
}

.prompt-md-inline-code {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 13px;
}

.prompt-md-param {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: monospace;
    margin: 1px 2px;
}

.prompt-md-code-wrap {
    position: relative;
    margin: 14px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0b1120;
}

.prompt-code-lang {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: #64748b;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.prompt-md-code-block {
    padding: 16px;
    margin: 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    color: #e2e8f0;
}

.prompt-md-callout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    margin: 14px 0;
    font-size: 14px;
    line-height: 1.6;
}

.prompt-md-callout-note {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #ddd6fe;
}

.prompt-md-callout-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fde68a;
}

.prompt-md-callout-tip {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.prompt-md-callout i {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ─── View Prompt Footer ─────────────────────────────────────────────────── */
.view-prompt-footer {
    padding: 18px 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.view-footer-left, .view-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-action-delete,
.btn-action-duplicate,
.btn-action-edit {
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-action-delete {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #f87171;
}

.btn-action-delete:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.btn-action-duplicate {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

.btn-action-duplicate:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.btn-action-edit {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border: none;
    color: #ffffff;
    padding: 9px 18px;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-action-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45);
}

/* Toast Notification (Bubble Style) */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-align: center;
    pointer-events: none;
}

.toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.toast.error {
    background: rgba(239, 68, 68, 0.95);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.25);
}

.toast.success {
    background: rgba(16, 185, 129, 0.95);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.25);
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageTurnIn {
    0% { opacity: 0; transform: perspective(1200px) rotateY(-90deg); }
    100% { opacity: 1; transform: perspective(1200px) rotateY(0deg); }
}

@keyframes zoomIn {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideDownFade {
    0% { opacity: 0; transform: translateY(-50px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes rotateIn {
    0% { opacity: 0; transform: rotate(-180deg) scale(0.5); }
    100% { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes flipInX {
    0% { opacity: 0; transform: perspective(1000px) rotateX(-90deg); }
    100% { opacity: 1; transform: perspective(1000px) rotateX(0deg); }
}

@keyframes flipInY {
    0% { opacity: 0; transform: perspective(1000px) rotateY(-90deg); }
    100% { opacity: 1; transform: perspective(1000px) rotateY(0deg); }
}

@keyframes rollIn {
    0% { opacity: 0; transform: translateX(-100%) rotate(-120deg); }
    100% { opacity: 1; transform: translateX(0) rotate(0); }
}

@keyframes swingIn {
    0% { opacity: 0; transform: rotateX(-100deg); transform-origin: top; }
    100% { opacity: 1; transform: rotateX(0); transform-origin: top; }
}

#customAlertDialog.active .modal-content.anim-pageTurn { animation: pageTurnIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; transform-origin: left center; }
#customAlertDialog.active .modal-content.anim-zoom { animation: zoomIn 0.4s ease-out forwards; }
#customAlertDialog.active .modal-content.anim-slideUp { animation: slideUpFade 0.4s ease-out forwards; }
#customAlertDialog.active .modal-content.anim-slideDown { animation: slideDownFade 0.4s ease-out forwards; }
#customAlertDialog.active .modal-content.anim-rotate { animation: rotateIn 0.5s ease-out forwards; }
#customAlertDialog.active .modal-content.anim-bounce { animation: bounceIn 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; }
#customAlertDialog.active .modal-content.anim-flipX { animation: flipInX 0.5s ease-out forwards; transform-origin: center; }
#customAlertDialog.active .modal-content.anim-flipY { animation: flipInY 0.5s ease-out forwards; transform-origin: center; }
#customAlertDialog.active .modal-content.anim-roll { animation: rollIn 0.5s ease-out forwards; }
#customAlertDialog.active .modal-content.anim-swing { animation: swingIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; transform-origin: top; }

.text-muted {
    color: #94a3b8;
    margin-top: 8px;
    font-size: 14px;
}

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

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

/* Light Theme Overrides */
body.light-theme {
    background: #f8fafc;
    color: #1f2937;
}

body.light-theme .app-container {
    background: #f8fafc;
}

body.light-theme .sidebar {
    background: #ffffff;
    color: #1f2937;
    border-right: 1px solid #e2e8f0;
}

body.light-theme .sidebar-header {
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .sidebar-footer {
    border-top: 1px solid #e2e8f0;
    color: #64748b;
}

body.light-theme .category-item {
    color: #475569;
}

body.light-theme .category-item:hover {
    color: #6d28d9;
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.02) translateX(4px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

body.light-theme .category-item.active {
    color: #6d28d9;
    background: rgba(139, 92, 246, 0.1);
}

body.light-theme .category-item:hover::before {
    opacity: 0;
}

body.light-theme .category-count {
    background: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
}

/* Trash Bin Item Box Styling (Dark & Light Theme) */
.category-item[data-category="trash"] {
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    margin-top: 8px;
}

.category-item[data-category="trash"] i {
    color: #ef4444;
}

.category-item[data-category="trash"] .category-count {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.category-item[data-category="trash"]:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ffffff;
    transform: scale(1.02) translateX(4px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.18);
}

.category-item[data-category="trash"].active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.35) 0%, rgba(185, 28, 28, 0.4) 100%);
    border: 1px solid #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.category-item[data-category="trash"].active i {
    color: #ffffff;
}

.category-item[data-category="trash"].active .category-count {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* Light Theme Trash Bin Box & Text Contrast Overrides */
body.light-theme .categories-section h3 {
    color: #64748b !important;
    opacity: 1 !important;
}

body.light-theme #subCategoriesWrapper {
    border-left-color: #cbd5e1 !important;
}

body.light-theme .category-item[data-category="trash"] {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
}

body.light-theme .category-item[data-category="trash"] i {
    color: #dc2626 !important;
}

body.light-theme .category-item[data-category="trash"] .category-count {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

body.light-theme .category-item[data-category="trash"]:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}

body.light-theme .category-item[data-category="trash"].active {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    border: 1px solid #ef4444 !important;
    color: #991b1b !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15) !important;
}

body.light-theme .category-item[data-category="trash"].active i,
body.light-theme .category-item[data-category="trash"].active span {
    color: #991b1b !important;
}

body.light-theme .category-item[data-category="trash"].active .category-count {
    background: #ef4444 !important;
    color: #ffffff !important;
}

body.light-theme .empty-state h3 {
    color: #1e293b !important;
}

body.light-theme .empty-state p {
    color: #64748b !important;
}

body.light-theme .empty-state i {
    color: #94a3b8 !important;
}

body.light-theme .text-muted {
    color: #64748b !important;
}

body.light-theme #toggleCategoriesCollapseBtn {
    color: #64748b !important;
}

body.light-theme .content-header h1 {
    color: #1e293b;
}

body.light-theme .prompt-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

body.light-theme .prompt-title {
    color: #1e293b;
}

body.light-theme .prompt-text {
    color: #64748b;
}

body.light-theme .prompt-actions button {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

body.light-theme .prompt-actions button:hover {
    background: #8b5cf6;
    color: white;
}

body.light-theme .search-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}



body.light-theme .search-box input {
    color: #1e293b !important;
}

body.light-theme .search-box input::placeholder {
    color: #94a3b8;
}

body.light-theme .view-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

body.light-theme .view-btn.active {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* --- Cloud Sync Badge --- */
.sync-status-badge {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(109, 40, 217, 0.3) 100%);
    border: 1px solid rgba(167, 139, 250, 0.45);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sync-status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
    border-color: rgba(167, 139, 250, 0.8);
}

.sync-status-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #e9d5ff;
}

.sync-status-inner i {
    font-size: 15px;
    color: #c084fc;
}

/* Modal Body Typography - Dark Default */
.modal-body {
    line-height: 1.6;
    color: #cbd5e1;
}

.modal-body h3 {
    color: #f8fafc;
    margin-top: 16px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body p {
    color: #cbd5e1;
    margin-bottom: 16px;
    font-size: 14px;
}

.modal-body code {
    background: rgba(139, 92, 246, 0.2);
    color: #d8b4fe;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

body.light-theme .modal-content {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .modal-header h2 {
    color: #0f172a !important;
}

body.light-theme .modal-body {
    color: #334155 !important;
}

body.light-theme .modal-body h3 {
    color: #0f172a !important;
}

body.light-theme .modal-body p {
    color: #475569 !important;
}

body.light-theme .modal-body ul li {
    color: #334155 !important;
}

body.light-theme .modal-body strong {
    color: #0f172a !important;
}

body.light-theme .modal-body code {
    background: #f3e8ff !important;
    color: #6b21a8 !important;
    border: 1px solid #d8b4fe !important;
}

/* Light Theme Cloud Sync Badge */
body.light-theme .sync-status-badge {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border: 1px solid #c084fc;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15);
}

body.light-theme .sync-status-badge:hover {
    background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
    box-shadow: 0 6px 18px rgba(147, 51, 234, 0.25);
    border-color: #a855f7;
}

/* ════════════════════════════════════════════════
   CLOUD SYNC MODAL STYLES (Ultra Modern & Premium)
   ════════════════════════════════════════════════ */

.sync-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-modal-box {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
}

.sync-key-label {
    color: #c4b5fd;
    font-size: 12px;
    margin: 0;
    font-weight: 600;
}

.sync-key-text {
    color: #f8fafc;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    word-break: break-all;
    margin: 4px 0 0 0;
}

.sync-tool-btn {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.35);
    color: #ddd6fe;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.sync-tool-btn:hover {
    background: rgba(139, 92, 246, 0.4);
    color: #ffffff;
    border-color: #a78bfa;
}

.sync-btn-primary {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border: none;
    color: #ffffff !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.sync-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.sync-btn-secondary {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1 !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.sync-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25);
}

.sync-btn-danger {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171 !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.sync-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4);
}

/* ─── LIGHT THEME OVERRIDES FOR CLOUD SYNC MODAL ─── */

body.light-theme .sync-modal-title {
    color: #0f172a !important;
}

body.light-theme .sync-modal-box {
    background: linear-gradient(135deg, #f3e8ff 0%, #faf5ff 100%) !important;
    border: 1px solid #d8b4fe !important;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.08) !important;
}

body.light-theme .sync-key-label {
    color: #7e22ce !important;
}

body.light-theme .sync-key-text {
    color: #3b0764 !important;
}

body.light-theme .sync-tool-btn {
    background: #e9d5ff !important;
    border: 1px solid #c084fc !important;
    color: #6b21a8 !important;
}

body.light-theme .sync-tool-btn:hover {
    background: #d8b4fe !important;
    color: #3b0764 !important;
    border-color: #a855f7 !important;
}

body.light-theme .sync-btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35) !important;
}

body.light-theme .sync-btn-secondary {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .sync-btn-secondary:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

body.light-theme .sync-btn-danger {
    background: #fef2f2 !important;
    border: 1px solid #fca5a5 !important;
    color: #dc2626 !important;
}

body.light-theme .sync-btn-danger:hover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #f87171 !important;
}

body.light-theme .sync-status-inner {
    color: #581c87 !important;
    font-weight: 700;
}

body.light-theme .sync-status-inner i {
    color: #7e22ce !important;
}

body.light-theme #syncKeyModal .modal-content {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme #syncKeyModal h2 {
    color: #0f172a !important;
}

body.light-theme #syncKeyModal p {
    color: #475569 !important;
}

body.light-theme #syncKeyModal strong {
    color: #6d28d9 !important;
}

body.light-theme #syncKeyModal input {
    background: #f8fafc !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme #syncKeyModal input::placeholder {
    color: #94a3b8 !important;
}

body.light-theme #syncKeyModal #skipSyncBtn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme #syncKeyModal #skipSyncBtn:hover {
    background: #e2e8f0 !important;
}

body.light-theme #syncKeyModal i.fa-cloud-upload-alt {
    color: #6d28d9 !important;
}

body.light-theme .modal-header {
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .form-group label {
    color: #475569;
}

body.light-theme .form-group input, 
body.light-theme .form-group textarea, 
body.light-theme .form-group select {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

body.light-theme .form-group select option {
    background: #ffffff;
    color: #1e293b;
}

body.light-theme .form-group input:focus, 
body.light-theme .form-group textarea:focus, 
body.light-theme .form-group select:focus {
    background: #ffffff;
}

body.light-theme .close-modal, 
body.light-theme .close-delete-modal,
body.light-theme .close-info-modal,
body.light-theme .close-custom-alert {
    color: #64748b;
}

body.light-theme .image-upload-area {
    border-color: #cbd5e1;
    background: #f8fafc;
}

body.light-theme #customPromptDialog .modal-content,
body.light-theme .view-prompt-modal-content,
body.light-theme .edit-prompt-modal-content {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .view-prompt-header,
body.light-theme .edit-modal-footer,
body.light-theme .view-prompt-footer,
body.light-theme .modal-header,
body.light-theme .modal-footer {
    background: #ffffff !important;
    border-color: #f1f5f9 !important;
}

body.light-theme .view-prompt-title-row h2 {
    color: #0f172a !important;
}

body.light-theme .view-prompt-badge {
    background: #f3e8ff !important;
    border-color: #d8b4fe !important;
    color: #6b21a8 !important;
}

body.light-theme .view-prompt-meta-item {
    color: #64748b !important;
}

body.light-theme .view-copy-btn {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
    color: #6d28d9 !important;
}

body.light-theme .view-copy-btn:hover {
    background: #7c3aed !important;
    color: #ffffff !important;
}

body.light-theme .view-prompt-image-container {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .view-prompt-image {
    background: #f8fafc !important;
}

body.light-theme .view-prompt-content-card {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .view-prompt-content-header {
    border-color: #e2e8f0 !important;
}

body.light-theme .view-prompt-content-label {
    color: #6d28d9 !important;
}

body.light-theme .prompt-markdown-body {
    color: #334155 !important;
}

body.light-theme .prompt-md-h {
    color: #0f172a !important;
}

body.light-theme .prompt-md-h1 {
    color: #6d28d9 !important;
    border-left-color: #8b5cf6 !important;
}

body.light-theme .prompt-md-h2 {
    color: #7c3aed !important;
    border-left-color: #7c3aed !important;
}

body.light-theme .prompt-md-h3 {
    color: #1e293b !important;
}

body.light-theme .prompt-md-h4 {
    color: #475569 !important;
}

body.light-theme .prompt-md-ul li,
body.light-theme .prompt-md-ol li {
    color: #334155 !important;
}

body.light-theme .prompt-md-bold {
    color: #0f172a !important;
}

body.light-theme .prompt-md-italic {
    color: #334155 !important;
}

body.light-theme .prompt-md-inline-code {
    background: #f3e8ff !important;
    border-color: #d8b4fe !important;
    color: #6b21a8 !important;
}

body.light-theme .prompt-md-param {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

body.light-theme .prompt-md-code-wrap {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .prompt-code-lang {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

body.light-theme .prompt-md-code-block {
    color: #0f172a !important;
}

body.light-theme .prompt-md-callout-note {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
    color: #5b21b6 !important;
}

body.light-theme .prompt-md-callout-warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

body.light-theme .prompt-md-callout-tip {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #065f46 !important;
}

body.light-theme .btn-action-duplicate {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

body.light-theme .btn-action-duplicate:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

body.light-theme .btn-action-delete {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

body.light-theme .btn-action-delete:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}

body.light-theme .input-char-counter {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #64748b !important;
}

body.light-theme .image-preview-card {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .image-preview-thumb-wrap {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .upload-title {
    color: #1e293b !important;
}

body.light-theme .add-category-btn {
    background: #f3e8ff !important;
    border-color: #d8b4fe !important;
    color: #6b21a8 !important;
}

body.light-theme .add-category-btn:hover {
    background: #7c3aed !important;
    color: #ffffff !important;
}

body.light-theme .change-image-btn {
    background: #f3e8ff !important;
    border-color: #d8b4fe !important;
    color: #6b21a8 !important;
}

body.light-theme .change-image-btn:hover {
    background: #7c3aed !important;
    color: #ffffff !important;
}

body.light-theme .remove-image-btn {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

body.light-theme .remove-image-btn:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}

body.light-theme #customPromptInput {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

body.light-theme #customAlertTitle,
body.light-theme #customAlertText {
    color: #1e293b !important;
}

body.light-theme #themeToggleBtn {
    background: none !important;
    border: none !important;
}

body.light-theme .action-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569 !important;
}

body.light-theme .action-btn:hover {
    background: #f8fafc;
    color: #1e293b !important;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-theme .action-btn span {
    color: inherit !important;
}

body.light-theme .action-btn.secondary-btn {
    color: #64748b !important;
}

body.light-theme .logo span {
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stylish Theme Switch */
.theme-switch {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    outline: none;
}

.switch-track {
    width: 64px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

body.light-theme .switch-track {
    background: #e2e8f0;
    border-color: #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.switch-icon {
    font-size: 14px;
    z-index: 1;
}

.dark-icon {
    color: #94a3b8;
}

.light-icon {
    color: #f59e0b;
    opacity: 0.5;
}

body.light-theme .dark-icon {
    opacity: 0.5;
}

body.light-theme .light-icon {
    opacity: 1;
}

.switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 0;
}

body.light-theme .switch-thumb {
    transform: translateX(32px);
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ════════════════════════════════════════════════
   MOBILE RESPONSIVE STYLES
   ════════════════════════════════════════════════ */

/* --- Mobile Top Bar --- */
.mobile-topbar {
    display: none;
}

/* --- Sidebar Close Button (hidden on desktop) --- */
.sidebar-close-btn {
    display: none;
}

/* --- Sidebar Overlay (hidden on desktop) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ─── TABLET (≤ 900px) ─── */
@media (max-width: 900px) {
    .sidebar {
        width: 280px;
    }
    .prompts-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }
    .main-content {
        padding: 24px 20px;
    }
}

/* ─── MOBILE (≤ 640px) ─── */
@media (max-width: 640px) {

    /* Body no overflow hidden so main scrolls */
    body {
        overflow: auto;
    }

    /* --- App container becomes single column --- */
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    /* --- Sidebar: fixed overlay, slides in from left --- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 300px;
        max-width: 85vw;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: 6px 0 30px rgba(0, 0, 0, 0.4);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Show overlay when sidebar is open */
    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }

    .sidebar-overlay.active {
        pointer-events: auto;
    }

    /* --- Sidebar close button visible on mobile --- */
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: #cbd5e1;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 16px;
        transition: background 0.2s ease;
        flex-shrink: 0;
    }

    .sidebar-close-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    body.light-theme .sidebar-close-btn {
        background: rgba(0, 0, 0, 0.05);
        color: #64748b;
    }

    /* --- Mobile Top Bar --- */
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: #1e293b;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        position: sticky;
        top: 0;
        z-index: 100;
        min-height: 56px;
    }

    body.light-theme .mobile-topbar {
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
    }

    .mobile-logo {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        font-weight: 700;
        font-size: 15px;
        color: #f8fafc;
        overflow: hidden;
    }

    body.light-theme .mobile-logo {
        color: #1e293b;
    }

    .mobile-logo span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hamburger button */
    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        padding: 6px;
        background: rgba(255, 255, 255, 0.08);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.2s ease;
    }

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

    body.light-theme .hamburger-btn {
        background: #f1f5f9;
    }

    .hamburger-btn span {
        display: block;
        height: 2px;
        width: 100%;
        background: #a78bfa;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Mobile add (+) button in topbar */
    .mobile-add-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, #8b5cf6, #6d28d9);
        border: none;
        border-radius: 8px;
        color: white;
        font-size: 15px;
        cursor: pointer;
        flex-shrink: 0;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .mobile-add-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
    }

    /* --- Main Content: full width, normal scroll --- */
    .main-content {
        padding: 16px 14px;
        overflow-y: visible;
        flex: 1;
        width: 100%;
        box-sizing: border-box;
    }

    /* --- Content header responsive --- */
    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 20px;
        width: 100%;
    }

    .content-header h1 {
        font-size: 20px;
    }

    .header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .search-box {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .header-tools {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    /* --- Prompts grid: single column on mobile --- */
    .prompts-container {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* --- List view image smaller --- */
    .list-view .prompt-image {
        width: 90px;
        height: 90px;
    }

    /* --- Modal full-screen on mobile --- */
    .modal-content,
    .view-prompt-modal-content,
    .edit-prompt-modal-content {
        width: 96% !important;
        max-width: 96% !important;
        max-height: 94vh !important;
        border-radius: 18px !important;
    }

    .view-prompt-header {
        padding: 16px 18px !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .view-prompt-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .view-prompt-title-row h2 {
        font-size: 17px !important;
    }

    .view-prompt-body,
    .edit-modal-body {
        padding: 16px 18px !important;
    }

    .view-prompt-footer,
    .edit-modal-footer {
        padding: 14px 18px !important;
    }

    .view-prompt-footer {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .view-footer-left,
    .view-footer-right {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }

    .view-footer-left button,
    .view-footer-right button {
        flex: 1;
        justify-content: center;
    }
}
/* Custom Sync Modal Styles */
.sync-modal-custom, .sync-manager-custom {
    border-radius: 24px;
    padding: 36px;
    text-align: center;
    border: 1px solid rgba(139,92,246,0.3);
    background: rgba(15,23,42,0.97);
    backdrop-filter: blur(20px);
    max-width: 420px;
}
.sync-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(139,92,246,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1px solid rgba(139,92,246,0.3);
}
.sync-modal-icon i {
    font-size: 24px;
    color: #a78bfa;
}
.sync-modal-custom h2 {
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #f8fafc;
}
.sync-modal-desc {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}
.sync-modal-desc strong {
    color: #c4b5fd;
}
.sync-modal-desc span {
    font-size: 12px;
    opacity: 0.7;
}
.sync-key-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    margin-bottom: 8px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    letter-spacing: 1px;
}
.sync-key-input:focus {
    border-color: #8b5cf6;
}
.sync-modal-warning {
    color: #64748b;
    font-size: 11px;
    margin-bottom: 20px;
    text-align: left;
}
.sync-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.btn-skip-sync {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
}
.btn-skip-sync:hover {
    background: rgba(255,255,255,0.1);
}
.btn-enable-sync {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s;
}
.btn-enable-sync:hover {
    opacity: 0.85;
}

/* Sync Manager */
.sync-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.sync-modal-title {
    color: #f8fafc;
}
.sync-modal-title i {
    color: #8b5cf6;
}
.sync-modal-box {
    text-align: left;
}
.sync-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.sync-key-label {
    color: #f8fafc;
}
.sync-box-actions {
    display: flex;
    gap: 8px;
}
.sync-key-hidden-msg {
    font-size: 11px;
    margin-top: 8px;
    margin-bottom: 0;
    opacity: 0.7;
    color: #f8fafc;
}
.sync-manager-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Light Theme Overrides for Sync Modals */
body.light-theme .sync-modal-custom, 
body.light-theme .sync-manager-custom {
    background: #ffffff;
    border-color: rgba(139,92,246,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
body.light-theme .sync-modal-custom h2,
body.light-theme .sync-manager-header .sync-modal-title,
body.light-theme .sync-key-label,
body.light-theme .sync-key-text,
body.light-theme .sync-key-hidden-msg {
    color: #1e293b;
}
body.light-theme .sync-modal-desc {
    color: #64748b;
}
body.light-theme .sync-key-input {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}
body.light-theme .btn-skip-sync {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}
body.light-theme .btn-skip-sync:hover {
    background: #e2e8f0;
}
