/* --- Global Styles & Variables --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --accent: #8b5cf6;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    /* NEW: Cross-browser font smoothing */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.icon {
    width: 1em;
    height: 1em;
    stroke-width: 2;
    vertical-align: middle;
    flex-shrink: 0;
}

/* --- Header & Global Language Switch --- */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.global-lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    z-index: 10;
}

.global-lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

.global-lang-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

header h1 {
    /* UPDATED: Fluid typography */
    font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 100px;
}

header h1 .icon { width: 1.2em; height: 1.2em; }

header p { 
    /* UPDATED: Fluid typography */
    font-size: clamp(0.9rem, 0.8rem + 0.5vw, 1rem);
    opacity: 0.95; 
    max-width: 900px; 
}
/* NEW: Style for the disclaimer in the header */
header p.disclaimer {
    font-size: 12px; /* Make it smaller than the main description */
    opacity: 0.7;    /* Make it less prominent */
    margin-top: 16px;/* Add some space above it */
    max-width: 100%; /* Ensure it doesn't get restricted by the main p's max-width */
    line-height: 1.5;
}

/* --- Tabs --- */
.tabs-container { 
    background: white; 
    border-radius: 12px; 
    padding: 8px; 
    margin-bottom: 30px; 
    box-shadow: var(--shadow); 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
}
.tabs { display: flex; gap: 8px; min-width: min-content; }
.tab { padding: 12px 24px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-secondary); transition: all 0.3s ease; white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.tab .icon { width: 16px; height: 16px; }
.tab:hover { background: var(--bg-main); color: var(--text-primary); }
.tab.active { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3); }

/* --- Content Area & Layouts --- */
.content-area { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.major-category-description {
    background-color: var(--bg-card);
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
    /* UPDATED: Fluid typography */
    font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
    color: var(--text-secondary);
}

.main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 30px; align-items: flex-start; }

.placeholder-section { background: var(--bg-card); border-radius: 12px; padding: 60px 30px; text-align: center; color: var(--text-secondary); box-shadow: var(--shadow); }
.placeholder-icon { font-size: 48px; margin-bottom: 20px; color: var(--border); }
.placeholder-icon .icon { width: 48px; height: 48px; stroke-width: 1.5; }
.placeholder-title { font-size: 22px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }

/* --- Right Sidebar Filters --- */
.filters-sidebar { position: sticky; top: 20px; background: var(--bg-card); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.filters-sidebar h3 { font-size: 16px; padding-bottom: 10px; margin-bottom: 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.filter-list { list-style-type: none; }
.filter-btn { width: 100%; padding: 12px 15px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-secondary); transition: all 0.2s ease; text-align: left; display: flex; align-items: center; gap: 10px; }
.filter-btn:hover { background: var(--primary-light); color: var(--primary-dark); }
.filter-btn.active { background: var(--primary); color: white; }
.filter-btn .icon { width: 18px; height: 18px; }

/* --- Prompt Cards Grid --- */
.prompts-grid { display: grid; gap: 20px; }

.subcategory-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}
.subcategory-header h2 {
    /* UPDATED: Fluid typography */
    font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem);
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.subcategory-header h2 .icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}
.subcategory-header p {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 30px; /* Align with title text */
}

.prompt-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); transition: all 0.3s ease; }
.prompt-card.hidden { display: none; }
.prompt-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* --- Card Content Styles --- */
.prompt-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; gap: 15px; }
.prompt-title { 
    /* UPDATED: Fluid typography */
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
    font-weight: 600; 
    color: var(--primary); 
    flex: 1; 
}
.lang-toggle { display: flex; gap: 5px; flex-shrink: 0; }
.lang-btn { padding: 6px 12px; border: 1px solid var(--border); background: white; border-radius: 6px; cursor: pointer; font-size: 12px; transition: all 0.2s; font-weight: 500; }
.lang-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.variables-form { background: #f0f9ff; border: 2px solid #bae6fd; border-radius: 8px; padding: 15px; margin-bottom: 12px; }
.form-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.form-header .icon { width: 16px; height: 16px; color: var(--text-secondary); }
.form-group { margin-bottom: 10px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; transition: all 0.2s; background: white; }
textarea.form-input { min-height: 80px; resize: vertical; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.form-input::placeholder { color: #94a3b8; }
.prompt-content { background: white; padding: 15px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 12px; }
.prompt-text { font-size: 14px; line-height: 1.7; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.variable-highlight { background: #fef3c7; padding: 2px 6px; border-radius: 4px; font-weight: 600; color: #92400e; border: 1px solid #fbbf24; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn .icon { width: 14px; height: 14px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* --- Toast Notification --- */
.toast { position: fixed; bottom: 30px; right: 30px; background: var(--text-primary); color: white; padding: 12px 20px; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 1000; opacity: 0; transform: translateX(100%); transition: all 0.4s cubic-bezier(0.215, 0.610, 0.355, 1); pointer-events: none; display: flex; align-items: center; gap: 10px; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast .icon { width: 18px; height: 18px; color: var(--secondary); }

/* --- Back to Top Button --- */
.back-to-top-btn { position: fixed; bottom: 30px; right: 30px; width: 48px; height: 48px; background-color: var(--primary); color: white; border: none; border-radius: 50%; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); display: flex; align-items: center; justify-content: center; z-index: 999; opacity: 0; visibility: hidden; transform: translateY(20px); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; }
.back-to-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top-btn:hover { background-color: var(--primary-dark); transform: translateY(-2px); }
.back-to-top-btn .icon { width: 24px; height: 24px; stroke-width: 2.5; }


/* --- Responsive Design --- */
@media (max-width: 992px) { 
    .main-layout { grid-template-columns: 1fr; } 
    .filters-sidebar { position: static; margin-bottom: 30px; } 
}
@media (max-width: 768px) { 
    .container { padding: 15px; } 
    header { padding: 30px 20px; } 
    .global-lang-switch { top: 15px; right: 15px; } 
    header h1 { padding-right: 80px; } 
    .prompt-header { flex-direction: column; align-items: flex-start; } 
    .lang-toggle { width: 100%; } 
    .lang-btn { flex: 1; } 
    .actions { width: 100%; } 
    .btn { flex: 1; justify-content: center; } 
}
/* NEW: Added media query for very small screens */
@media (max-width: 480px) {
    .container { padding: 10px; }
    .tab { padding: 10px 16px; font-size: 14px; }
    .major-category-description { padding: 15px; }
    .prompt-card { padding: 15px; }
    .back-to-top-btn { bottom: 20px; right: 20px; width: 44px; height: 44px; }
    .toast { bottom: 20px; right: 20px; left: 20px; transform: translateY(150%); }
    .toast.show { transform: translateY(0); }
}

/* --- Site Footer --- */
.site-footer {
    padding: 40px 0;
    margin-top: 40px;
    background-color: transparent; /* Or var(--bg-card) if you want a slight background */
    border-top: 1px solid var(--border);
    text-align: center;
}

.site-footer p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    max-width: 800px;
    margin: 0 auto;
}

.site-footer p:first-of-type {
    margin-bottom: 12px;
}

.site-footer strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Adjust padding for smaller screens */
@media (max-width: 768px) {
    .site-footer {
        padding: 30px 0;
        margin-top: 30px;
    }
}
