/* ======================
   RESET & BASE STYLES
   ====================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
      Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.tool-page {
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    min-height: 100vh;
}

.tool-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ======================
   TOOL HEADER
   ====================== */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tool-header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-weight: 700;
}

.tool-header h1 i {
    color: #667eea;
    margin-right: 1rem;
}

.tool-description {
    color: #666;
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ======================
   TOOL INSTRUCTIONS
   ====================== */
.tool-instructions {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tool-instructions h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
}

.tool-instructions h2 i {
    color: #f39c12;
    margin-right: 0.5rem;
}

.instructions-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.instruction-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.step-content h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

/* ======================
   GENERATOR CONTAINER
   ====================== */
.generator-container {
    margin-bottom: 3rem;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.input-section {
    margin-bottom: 3rem;
}

.prompt-input {
    margin-bottom: 2rem;
}

.prompt-input label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.prompt-input label i {
    color: #667eea;
    margin-right: 0.5rem;
}

.prompt-input textarea {
    width: 100%;
    height: 140px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.prompt-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.prompt-suggestions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.suggestion-label {
    color: #666;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.suggestion-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.suggestion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.option-group {
    background: rgba(248, 249, 250, 0.8);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.option-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.option-group label i {
    color: #667eea;
    margin-right: 0.5rem;
}

.option-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.option-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: normal;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.checkbox-list label:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.checkbox-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.checkbox-list i {
    color: #667eea;
    width: 16px;
}

.generation-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-width: 200px;
    justify-content: center;
    font-size: 1.1rem;
}

.action-btn.secondary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    border: 2px solid #dee2e6;
}

.action-btn.secondary:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #667eea;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ======================
   OUTPUT SECTION
   ====================== */
.output-section {
    border-top: 2px solid #e9ecef;
    padding-top: 2rem;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.output-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.output-header h3 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.code-metrics {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.metric {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.metric-label {
    font-weight: 600;
}

.quality-indicator {
    width: 100px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.quality-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.code-output {
    margin-bottom: 2rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.code-output pre {
    margin: 0;
    padding: 2rem;
    background: #2d3748;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 600px;
    overflow: auto;
    color: #e2e8f0;
}

.code-output code {
    font-family: inherit;
}

.code-explanation {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 1rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.code-explanation h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.code-explanation h4 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.output-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ======================
   CODE TEMPLATES
   ====================== */
.code-templates {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.code-templates h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.code-templates h2 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.template-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.template-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.15);
}

.template-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.template-icon i {
    font-size: 2rem;
    color: white;
}

.template-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.template-card p {
    color: #666;
    line-height: 1.6;
}

/* ======================
   BLOG CONTENT STYLES
   ====================== */
.blog-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.blog-content h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.blog-content h2 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.blog-content h3 {
    color: #2c3e50;
    margin: 2rem 0 1rem;
    font-size: 1.4rem;
}

.blog-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #555;
}

.blog-content ul, .blog-content ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.blog-content li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.blog-content article {
    margin-bottom: 3rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 2rem;
}

.blog-content article:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Language Grid */
.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.language-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.language-item:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.language-item i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.language-item span {
    font-weight: 600;
    color: #2c3e50;
}

/* ======================
   FAQ SECTION STYLES
   ====================== */
.faq-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.faq-section h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.faq-section h2 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.faq-item {
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 2rem;
    transition: all 0.3s ease;
}

.faq-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item:hover {
    background: rgba(102, 126, 234, 0.02);
    padding: 1rem;
    border-radius: 10px;
    margin: -1rem -1rem 2rem -1rem;
}

.faq-item h3 {
    display: flex;
    align-items: center;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.2rem;
}

.faq-item h3::before {
    content: "Q:";
    margin-right: 1rem;
    color: #667eea;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.faq-item p {
    padding-left: 2rem;
    line-height: 1.8;
    color: #555;
}

/* ======================
   ENHANCED CODE EDITOR
   ====================== */
.code-editor-section {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-bottom: 2px solid #4a5568;
}

.editor-title {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
}

.editor-title i {
    margin-right: 0.75rem;
    color: #667eea;
    font-size: 1.3rem;
}

.editor-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.editor-select {
    background: #4a5568;
    color: #fff;
    border: 2px solid #667eea;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.editor-select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.editor-btn {
    background: #4a5568;
    color: #fff;
    border: 2px solid #667eea;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.editor-btn:hover {
    background: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.editor-btn.run-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-color: #48bb78;
}

.editor-btn.run-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.editor-btn.save-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border-color: #4299e1;
}

.editor-btn.close-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border-color: #f56565;
}

.editor-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: calc(100% - 70px);
    overflow: hidden;
}

.monaco-editor-container {
    width: 100%;
    height: 70%;
    overflow: hidden;
    border-bottom: 2px solid #4a5568;
}

.editor-console {
    height: 30%;
    background: #1a202c;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #2d3748;
    border-bottom: 1px solid #4a5568;
    font-size: 0.9rem;
    font-weight: 600;
}

.console-header i {
    color: #667eea;
    margin-right: 0.5rem;
}

.console-clear {
    background: transparent;
    color: #a0aec0;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.console-clear:hover {
    color: #fff;
    background: #4a5568;
}

.console-output {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.console-log {
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.console-error {
    color: #f56565;
}

.console-warn {
    color: #ed8936;
}

.console-info {
    color: #4299e1;
}

.console-success {
    color: #48bb78;
}

/* ======================
   LOADING STATES
   ====================== */
.code-output.loading {
    position: relative;
}

.code-output.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top: 4px solid #667eea;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ======================
   NOTIFICATION SYSTEM
   ====================== */
.error-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    font-family: inherit;
}

.error-toast {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #fff;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    border-left: 5px solid #667eea;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(20px);
}

.error-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0) 70%);
    pointer-events: none;
}

.error-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.error-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.error-toast i {
    color: #667eea;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.error-toast .message {
    flex: 1;
}

.error-toast .title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.error-toast .text {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

.error-toast .progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
}

.error-toast .progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform linear;
}

/* Success toast */
.error-toast.success {
    border-left-color: #48bb78;
}

.error-toast.success i {
    color: #48bb78;
}

.error-toast.success .progress-bar {
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

/* Warning toast */
.error-toast.warning {
    border-left-color: #ed8936;
}

.error-toast.warning i {
    color: #ed8936;
}

.error-toast.warning .progress-bar {
    background: linear-gradient(90deg, #ed8936 0%, #dd6b20 100%);
}

/* ======================
   RESPONSIVE STYLES
   ====================== */
@media (max-width: 1200px) {
    .tool-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .options-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 2.5rem;
    }
    
    .instructions-container {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .code-metrics {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .output-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .generation-controls {
        flex-direction: column;
    }
    
    .language-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .editor-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .editor-btn, .editor-select {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .monaco-editor-container {
        height: 60%;
    }
    
    .editor-console {
        height: 40%;
    }
}

@media (max-width: 576px) {
    .tool-page {
        padding: 1rem 0.5rem;
    }
    
    .tool-header {
        padding: 1.5rem;
    }
    
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .tool-description {
        font-size: 1rem;
    }
    
    .generator-container,
    .tool-instructions,
    .blog-content,
    .faq-section,
    .code-templates {
        padding: 1.5rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-content h3 {
        font-size: 1.1rem;
    }
    
    .prompt-suggestions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .suggestion-btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .template-icon {
        width: 60px;
        height: 60px;
    }
    
    .template-icon i {
        font-size: 1.5rem;
    }
    
    .error-notification-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* ======================
   DARK MODE SUPPORT
   ====================== */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .tool-header,
    .generator-container,
    .tool-instructions,
    .blog-content,
    .faq-section,
    .code-templates {
        background: rgba(45, 55, 72, 0.95);
        color: #e2e8f0;
    }
    
    .tool-header h1,
    .tool-instructions h2,
    .blog-content h2,
    .faq-section h2,
    .code-templates h2 {
        color: #e2e8f0;
    }
    
    .tool-description,
    .step-content p,
    .blog-content p,
    .faq-item p {
        color: #a0aec0;
    }
    
    .option-group {
        background: rgba(26, 32, 44, 0.8);
    }
    
    .option-group select,
    .prompt-input textarea {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .template-card,
    .language-item,
    .instruction-step {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: #e2e8f0;
    }
}

/* ======================
   PRINT STYLES
   ====================== */
@media print {
    .tool-page {
        background: white;
    }
    
    .code-editor-section,
    .output-actions,
    .generation-controls,
    .error-notification-container {
        display: none !important;
    }
    
    .code-output pre {
        background: #f8f9fa;
        color: #333;
        border: 1px solid #dee2e6;
    }
}