:root {
    --primary: #667eea;
    --primary-dark: #556cd6;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Layout */
.app { display: flex; min-height: 100vh; }

/* TOPBAR */
.topbar {
    background: white;
    border-radius: var(--radius);
    padding: 0 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 70px;
    margin-bottom: 24px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.logo-text h1 {
    font-weight: 700;
    font-size: 20px;
    color: var(--dark);
    margin: 0;
}

.logo-text p {
    color: var(--gray);
    font-size: 0.8rem;
    margin-top: 0;
}

.nav-menu {
    display: flex;
    gap: 5px;
    align-items: center;
    overflow: visible; /* Changed to allow dropdowns */
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    z-index: 3000;
    overflow: hidden;
    margin-top: 5px;
    border: 1px solid var(--border);
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    color: var(--dark);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-dropdown-content a:hover {
    background-color: var(--light);
    color: var(--primary);
    padding-left: 20px;
}

.nav-dropdown-content a.active {
    background-color: rgba(64, 93, 230, 0.05);
    color: var(--primary);
    font-weight: 600;
}

.nav-dropdown-content a i {
    width: 16px;
    text-align: center;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    padding: 12px 16px;
    background: none;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    color: var(--primary);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    color: var(--primary);
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.user-info-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.user-details {
    flex: 1;
}

.user-details .user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    display: block;
}

.user-details .user-role {
    font-size: 12px;
    color: var(--gray);
    display: block;
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* Preview Styles */
.preview-container {
    background: var(--light);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.preview-frame {
    max-width: 380px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    padding: 40px 20px;
    color: white;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    margin-bottom: 12px;
    object-fit: cover;
    background: white;
}

.preview-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-username {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    color: white;
}

.preview-bio {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.95;
    color: white;
    white-space: pre-line;
    margin-bottom: 16px;
}

.preview-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 16px 0;
    font-size: 12px;
}

.preview-stat {
    text-align: center;
}

.preview-stat strong {
    display: block;
    font-size: 15px;
    color: white;
}

.preview-stat span {
    opacity: 0.8;
    color: white;
}

/* FAQ Styles */
.faq-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    padding: 20px;
    background: var(--light);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.faq-item h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.faq-item p {
    color: var(--gray);
    line-height: 1.6;
}

/* Contact Styles */
.contact-content {
    padding: 20px 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius);
}

.contact-item i {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.contact-item span {
    color: var(--dark);
    font-weight: 500;
}

/* Color Picker Styles */
.color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker input[type="color"] {
    width: 70px;
    height: 70px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.color-picker span {
    font-family: monospace;
    color: var(--gray);
    font-size: 14px;
}

/* Export Styles */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.export-options .form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-options input[type="text"],
.export-options textarea {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 14px;
    background: var(--light);
}

.export-options textarea {
    min-height: 80px;
    resize: vertical;
}

.code-preview {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
}

.code-preview pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Preview Panel Mobile */
.preview-container {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.preview-container.open {
    right: 0;
}

.preview-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light);
}

.preview-container .preview-frame {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin: 0;
    border-radius: 0;
    min-height: auto;
    padding: 30px 16px;
    color: white;
    text-align: center;
}

.preview-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background: white;
}

.preview-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-username {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    text-align: center;
}

.preview-bio {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.95;
    text-align: center;
    margin-bottom: 16px;
    white-space: pre-line;
}

.preview-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 16px 0;
    font-size: 12px;
}

.preview-stat {
    text-align: center;
}

.preview-stat strong {
    display: block;
    font-size: 15px;
    color: white;
}

.preview-stat span {
    opacity: 0.8;
    color: white;
}

/* Preview Panel Mobile */
.preview-container {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.preview-container.open {
    right: 0;
}

.preview-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light);
}

.preview-container .preview-frame {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin: 0;
    border-radius: 0;
    min-height: auto;
}
@media (max-width: 1024px) {
    .sidebar {
        width: 72px;
        padding: 24px 8px;
    }
    
    .logo-text, .logo-sub, .nav-text, .user-details, .sidebar-actions {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main {
        margin-left: 72px;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    .nav-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-right {
        width: 100%;
        justify-content: center;
    }
    
    .nav-menu {
        gap: 1px;
        max-width: calc(100vw - 300px);
    }
    
    .nav-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .nav-left {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .nav-menu {
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
        max-width: none;
        margin-top: 10px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .nav-right {
        justify-content: center;
        margin-top: 10px;
    }
}

.nav-btn:hover {
    background: #f8f9fa;
    color: var(--primary);
}

.nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: linear-gradient(135deg, rgba(64, 93, 230, 0.1), rgba(131, 58, 180, 0.1));
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* CONTENT AREAS */
.content-area {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.content-area.active {
    display: block;
}

/* HOME PAGE */
.welcome-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    background: var(--instagram-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.welcome-section p {
    color: var(--gray);
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    border: 2px solid #e1e5e9;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 10px;
    background: var(--instagram-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-card .label {
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.quick-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* PROMPTS LIST PAGE */
.prompts-header {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.filters-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-actions {
    display: flex;
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 2px;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    background: white;
    min-width: 160px;
    height: 40px;
}

.search-box {
    position: relative;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 8px 15px 8px 35px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    font-size: 0.95rem;
    height: 40px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 0.9rem;
}

/* VIEW TOGGLE */
.view-toggle {
    display: flex;
    gap: 5px;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}

.btn-icon.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

/* Toggle Actions/Kebab based on View Mode */
.prompts-grid:not(.list-view) .action-btn-inline {
    display: none !important;
}

.prompts-grid.list-view .card-menu-btn {
    display: none !important;
}

/* Fix Header Overlap with Kebab Button in Grid View */
.prompts-grid:not(.list-view) .prompt-header {
    margin-right: 25px;
}

/* LIST VIEW STYLES */
.prompts-grid.list-view {
    display: block;
    grid-template-columns: 1fr;
    gap: 15px;
}

.prompts-grid.list-view .prompt-card {
    flex-direction: row;
    align-items: center;
    padding: 15px 25px;
    height: auto;
    gap: 20px;
}

.prompts-grid.list-view .prompt-header {
    margin-bottom: 0;
    min-width: 250px;
    flex-shrink: 0;
}

/* TABLE LIST VIEW */
.prompts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.prompts-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 700;
    color: #444;
    border-bottom: 2px solid #f0f0f0;
}

.prompts-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.prompts-table tbody tr:hover {
    background: #fafafa;
}

.prompts-table td.actions {
    text-align: right;
    white-space: nowrap;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.prompt-sub {
    color: #666;
    font-size: 0.85rem;
    margin-top: 4px;
}
.prompts-grid.list-view .prompt-preview {
    margin-bottom: 0;
    height: auto;
    max-height: none;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 20px;
    border-right: 1px solid #f0f0f0;
    margin-right: 20px;
}

.prompts-grid.list-view .prompt-preview:after {
    display: none;
}

.prompts-grid.list-view .prompt-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
}

/* RESPONSIVE LIST VIEW */
@media (max-width: 900px) {
    .prompts-grid.list-view .prompt-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .prompts-grid.list-view .prompt-header,
    .prompts-grid.list-view .prompt-preview {
        width: 100%;
        border-right: none;
        margin-right: 0;
        padding-right: 0;
    }
    
    .prompts-grid.list-view .prompt-actions {
        width: 100%;
        justify-content: flex-end;
        border-top: 1px solid #f0f0f0;
        padding-top: 15px;
    }
}

.prompt-card {
    background: white;
    border-radius: 16px; /* Arredondamento maior */
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04); /* Sombra mais suave */
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    /* overflow: hidden; Removed to allow dropdown */
}

.prompt-card:hover {
    transform: translateY(-4px);
    border-color: rgba(64, 93, 230, 0.3);
    box-shadow: 0 12px 30px rgba(64, 93, 230, 0.1);
}


.prompt-card:hover::before {
    opacity: 1;
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.prompt-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
    line-height: 1.3;
}
.prompt-title a {
    color: var(--dark);
    text-decoration: none;
    cursor: pointer;
}
.prompt-title a:hover {
    text-decoration: underline;
}

.prompt-type {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f2ff;
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-date {
    font-size: 0.75rem;
    color: var(--gray);
    white-space: nowrap;
    margin-left: 10px;
}

.prompt-preview {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    max-height: 80px;
    overflow: hidden;
    position: relative;
    flex-grow: 1;
}

.prompt-preview:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent, white);
}

.prompt-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.action-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.action-btn.copy {
    background: #e8f5e8;
    color: var(--success);
}

.action-btn.copy:hover {
    background: #d4edda;
}

.action-btn.view {
    background: #e8f4ff;
    color: var(--primary);
}

.action-btn.view:hover {
    background: #d0e7ff;
}

.action-btn.download {
    background: #f8f9fa;
    color: var(--dark);
}

.action-btn.download:hover {
    background: #e9ecef;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--gray);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.modal {
    background: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
    visibility: hidden;
    opacity: 0;
}

.modal-overlay.active .modal {
    visibility: visible;
    opacity: 1;
}

/* Modules Selection */
.modules-selection {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.module-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.module-checkbox {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.module-checkbox:hover {
    background-color: #f5f5f5;
}

.module-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.module-checkbox label {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-checkbox .module-icon {
    font-size: 12px;
    color: #666;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--gray);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.modal-body {
    padding: 25px 30px;
}

.prompt-viewer {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 25px;
    border-radius: 8px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    border: 2px solid #333;
    max-height: 400px;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
}

/* MODE SELECTOR */
.mode-selector {
    display: flex;
    gap: 10px;
}

.mode-btn {
    padding: 8px 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f8f9fa;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* MAIN CONTENT */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 1100px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* CARDS */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    height: fit-content;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--accent-color);
}

/* FORM STYLES */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.form-group {
    margin-bottom: 8px;
    position: relative;
}

.form-group.required label::after {
    content: " *";
    color: var(--danger);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-weight: 600;
    color: #444;
    font-size: 0.85rem;
}

.form-group label i {
    color: var(--secondary);
    width: 14px;
}

select, input, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: white;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64, 93, 230, 0.15);
}

textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.custom-input {
    margin-top: 10px;
    animation: fadeIn 0.3s;
}

.custom-input.hidden {
    display: none;
}

/* CHARACTER COUNTER */
.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 5px;
}

.char-counter.warning {
    color: var(--warning);
}

.char-counter.danger {
    color: var(--danger);
    font-weight: bold;
}

/* COLOR PICKER FOR TEXT */
.text-color-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.color-option {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.color-option label {
    font-size: 0.85rem;
    color: #555;
    font-weight: 500;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-preview-small {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid #ddd;
    cursor: pointer;
}

.color-hex-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: monospace;
}

.color-reset-btn {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.color-reset-btn:hover {
    background: #e9ecef;
}

/* COLOR PICKER */
.color-picker-btn {
    width: 100%;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.color-picker-btn:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

.color-display {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* BUTTONS */
.buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.action-btn.delete {
    color: var(--danger);
}

.action-btn.delete:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* COMPACT FORM STYLES */
#createPage .card {
    padding: 20px;
}

#createPage .form-grid {
    gap: 10px;
}

#createPage .form-group {
    margin-bottom: 0;
}

#createPage label {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

#createPage input,
#createPage select {
    height: 38px;
    padding: 6px 12px;
    font-size: 0.9rem;
}

#createPage textarea {
    padding: 8px 12px;
    font-size: 0.9rem;
}

#createPage .buttons {
    margin-top: 20px;
}

#createPage h2.card-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

/* CARD MENU & DROPDOWN */
.card-menu-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 1.1rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.card-menu-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--dark);
}

.card-actions-dropdown {
    position: absolute;
    top: 45px;
    right: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    width: 150px;
    z-index: 20;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.card-actions-dropdown.active {
    display: flex;
}

.dropdown-item {
    padding: 10px 15px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    width: 100%;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: var(--primary);
}

.dropdown-item.delete {
    color: var(--danger);
    border-top: 1px solid #eee;
}

.dropdown-item.delete:hover {
    background: #fff5f5;
}

/* SMALL BUTTONS (MODAL) */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: auto;
    flex: 0 1 auto;
}

.btn-minimal {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-minimal:hover {
    background: #f8f9fa;
    border-color: #ccc;
    color: #333;
}

.btn-minimal.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-minimal.primary:hover {
    background: #3451d1; /* Darker shade */
}

/* OUTPUT */
.prompt-output {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 25px;
    border-radius: 8px;
    min-height: 400px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-y: auto;
    border: 2px solid #333;
}

.prompt-header-output {
    color: #4EC9B0;
    margin-bottom: 10px;
    font-weight: 600;
}

.prompt-key {
    color: #9CDCFE;
}

.prompt-value {
    color: #CE9178;
}

.prompt-comment {
    color: #6A9955;
    font-style: italic;
}

/* PREVIEW */
.preview-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    border-left: 4px solid var(--primary);
    font-size: 0.9rem;
    color: #555;
    overflow-y: auto;
}

.preview-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Preview Links Styles */
.preview-links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.preview-link:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-link-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.preview-link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-link-content strong {
    font-size: 0.9rem;
    color: #1e293b;
}

.preview-link-content small {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.2;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* VALIDATION */
.error {
    border-color: var(--danger) !important;
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    
    .nav-left {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
    }
    
    .nav-btn {
        flex: 1;
        justify-content: center;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .mode-selector {
        width: 100%;
        justify-content: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .text-color-picker {
        grid-template-columns: 1fr;
    }
    
    .btn {
        min-width: 100%;
    }
    
    .prompts-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .container {
        padding: 10px;
    }
}
