/* Core Variables */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --gray-color: #95a5a6;
    --white-color: #ffffff;
    --body-bg: #f8f9fa;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition-speed: 0.3s;
    --input-max-height: 300px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
body {
    background-color: var(--body-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.app-header {
    margin-bottom: 2rem;
}

.nav-tabs .nav-link {
    color: var(--dark-color);
    border: none;
    padding: 0.75rem 1.25rem;
    transition: all var(--transition-speed);
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    background-color: rgba(52, 152, 219, 0.1);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 500;
}

.prompt-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

select, button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

#result {
    padding: 1rem;
    background-color: white;
    border-radius: 4px;
    min-height: 200px;
}

.container {
    max-width: 1400px;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all var(--transition-speed);
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-header {
    font-weight: 500;
    padding: 1rem;
    border-bottom: 2px solid rgba(0,0,0,0.125);
    background-color: #f8f9fa;
}

/* Form Styling */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    border-color: #86b7fe;
}

textarea.form-control {
    font-size: 0.95rem;
    max-height: var(--input-max-height);
    resize: vertical;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Tech Stack Select Styling */
select[multiple] {
    height: auto;
    min-height: 120px;
}

select[multiple] option {
    padding: 0.5rem;
    margin-bottom: 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

select[multiple] option:checked {
    background-color: #0d6efd linear-gradient(0deg, #0d6efd 0%, #0d6efd 100%);
    color: #fff;
}

/* Generated Prompt Styling */
#generatedPrompt {
    min-height: 200px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem !important;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    background: #f8f9fa;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.05);
    margin: 1rem 0;
    overflow-x: auto;
}

.generated-content {
    font-size: 0.95rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: #fff;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.generated-content pre {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

/* Keywords Styling */
#keywordsList {
    min-height: 38px;
    padding: 0.375rem;
    border: 1px dashed #dee2e6;
    border-radius: 4px;
    margin-top: 0.5rem;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

#keywordsList .badge {
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

#keywordsList .badge i {
    margin-left: 0.5rem;
    opacity: 0.7;
}

#keywordsList .badge:hover {
    transform: scale(1.05);
}

#keywordsList .badge:hover i {
    opacity: 1;
}

.keyword-badge {
    margin: 0.125rem;
    display: inline-block;
}

/* Navigation Tabs */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: #0d6efd;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    border: none;
    border-bottom: 2px solid #0d6efd;
    background: transparent;
}

/* SEO Options */
#seoOptions {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Loading Animation */
.loading {
    position: relative;
    color: transparent;
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(100deg, #f5f5f5 30%, #f0f0f0 50%, #f5f5f5 70%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Saved Prompts Styling */
.prompt-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.prompt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.prompt-card .prompt-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.prompt-card .prompt-type-badge.blog {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.prompt-card .prompt-type-badge.tech {
    background-color: #f3e5f5;
    color: #4a148c;
}

.prompt-card .prompt-type-badge.general {
    background-color: #e8f5e9;
    color: #1b5e20;
}

/* Action Buttons */
.copy-icon, .delete-icon {
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem;
    border-radius: 4px;
}

.copy-icon:hover {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.delete-icon:hover {
    background-color: #ffebee;
    color: #b71c1c;
}

/* Multi-select Styling */
select[multiple] {
    height: auto;
    min-height: 120px;
}

/* Tech Stack Selection */
#techStack option {
    padding: 0.5rem;
}

.custom-tech {
    margin-top: 0.5rem;
}

.custom-tech-input {
    margin-top: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    #generatedPrompt {
        min-height: 150px;
        padding: 1rem !important;
    }
    
    .card-header {
        padding: 0.75rem;
    }

    select[multiple] {
        min-height: 100px;
    }

    .tech-stack-section {
        padding: 0.75rem;
    }

    .input-group-text {
        min-width: 100px;
    }

    .card-body {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col-md-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Tooltips */
.tooltip-inner {
    max-width: 200px;
    padding: 6px 10px;
    background-color: #343a40;
    border-radius: 4px;
}

[data-bs-toggle="tooltip"] {
    cursor: help;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Tech Stack Card */
.tech-stack-section {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.tech-stack-section label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Requirements Cards */
.requirements-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.requirements-card textarea {
    resize: vertical;
    min-height: 80px;
}

/* Technical Requirements Icons */
.tech-req-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    color: #0d6efd;
}

/* Modal Styling */
.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-bottom: none;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Cheat Sheet Styling */
#cheatSheetContent {
    font-size: 0.95rem;
    line-height: 1.6;
}

#cheatSheetContent h3 {
    color: #0d6efd;
    margin-top: 2rem;
}

#cheatSheetContent h4 {
    color: #6610f2;
    margin-top: 1.5rem;
}

#cheatSheetContent ul {
    padding-left: 1.5rem;
}

#cheatSheetContent .badge {
    font-size: 1rem;
}

/* Custom Switch Styling */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* General Styles */
:root {
    --input-max-height: 100px;
    --transition-speed: 0.3s;
}

/* Form Controls */
.form-control {
    transition: all var(--transition-speed);
}

/* Input Groups */
.input-group {
    margin-bottom: 1rem;
}

.input-group-text {
    min-width: 120px;
    justify-content: start;
}

/* Compact Form Layout */
.compact-form .form-group {
    margin-bottom: 0.5rem;
}

.compact-form label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.compact-form .form-control {
    padding: 0.375rem 0.5rem;
}

/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 1rem;
}

.collapsible-section .card-header {
    cursor: pointer;
}

.collapsible-section .card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed);
}

.collapsible-section.expanded .card-body {
    max-height: 1000px;
}

.collapsible-section {
    margin-bottom: 1.5rem;
}

.collapsible-section h5 {
    cursor: pointer;
    padding: 0.75rem 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapsible-section h5:after {
    content: "";
    font-family: "bootstrap-icons";
    transition: transform var(--transition-speed);
}

.collapsible-section.expanded h5:after {
    transform: rotate(180deg);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: darken(var(--primary-color), 10%);
    border-color: darken(var(--primary-color), 10%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .input-group-text {
        min-width: 100px;
    }

    .card-body {
        padding: 0.75rem;
    }
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .generated-content {
        border: 1px solid #dee2e6;
    }
}