/* Blog Writer Styles - Following Established Layout Patterns */

.generator-container {
    flex: 1;
    padding: 0.5rem 0;
    overflow: hidden;
}

/* Generator Layout */
.generator-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 150px);
    gap: 0;
}

/* Controls Sidebar */
.controls-sidebar {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.sidebar-title i {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

/* Control Sections */
.control-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.control-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Checkbox Group */
.checkbox-group {
    margin-bottom: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

/* Full Width Controls */
#blogTopic {
    width: 100%;
}

#keyPoints {
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

#generateBtn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Results Area */
.results-area {
    background: var(--bg-secondary);
    padding: 2rem;
    overflow: auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

.results-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.generation-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

.generation-status.generating {
    color: var(--accent-primary);
    background: rgba(0, 180, 182, 0.1);
    border-color: var(--accent-primary);
}

.generation-status.success {
    color: var(--success);
    background: rgba(22, 163, 74, 0.1);
    border-color: var(--success);
}

.generation-status.error {
    color: var(--error);
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--error);
}

/* Blog Placeholder */
.blog-placeholder {
    background: var(--bg-primary);
    border: 2px dashed var(--border-medium);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.blog-placeholder i {
    font-size: 3rem;
    color: var(--text-muted);
}

.blog-placeholder h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.blog-placeholder p {
    color: var(--text-secondary);
    margin: 0;
}

.placeholder-features {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.feature-item i {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

/* Blog Content Display */
.blog-content-container {
    margin-bottom: 2rem;
}

.blog-post {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.blog-post:hover {
    box-shadow: var(--shadow-md);
}

.blog-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.blog-post-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0 0 1rem 0;
}

.blog-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.blog-meta-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

/* Blog Content Styling */
.blog-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.blog-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.blog-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem 0;
}

.blog-content p {
    margin: 0 0 1.5rem 0;
    text-align: justify;
}

.blog-content ul,
.blog-content ol {
    margin: 1rem 0 1.5rem 2rem;
    color: var(--text-primary);
}

.blog-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.blog-content blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}

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

.blog-content em {
    color: var(--text-secondary);
    font-style: italic;
}

/* Results Actions */
.results-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .results-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* History Button Styling */
.btn-history {
    background: linear-gradient(135deg, rgba(0, 180, 182, 0.1), rgba(0, 180, 182, 0.05));
    color: var(--accent-primary);
    border: 1px solid rgba(0, 180, 182, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-history:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 180, 182, 0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.btn-history:hover {
    background: linear-gradient(135deg, rgba(0, 180, 182, 0.15), rgba(0, 180, 182, 0.1));
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 182, 0.2);
}

.btn-history:hover:before {
    transform: translateX(0);
}

/* History Modal */
.history-modal .modal {
    max-width: 90vw;
    width: 600px;
    max-height: 80vh;
}

.history-modal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .history-modal .modal {
        width: 800px;
    }
}

@media (min-width: 1200px) {
    .history-modal .modal {
        width: 900px;
    }
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.history-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

.history-item-content {
    flex: 1;
    cursor: pointer;
}

.history-delete-btn {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--error);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.history-delete-btn:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.history-delete-btn i {
    width: 16px;
    height: 16px;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-item-preview {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.history-item-meta {
    font-size: 0.75rem;
    color: var(--accent-primary);
    background: rgba(0, 180, 182, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    display: inline-block;
}

.history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.history-empty i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.history-empty p {
    margin: 0.5rem 0;
}

/* AI Notice Styling */
.ai-notice {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid var(--warning);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.ai-notice p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.ai-notice i {
    color: var(--warning);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-link {
    background: none;
    border: none;
    color: var(--warning);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    margin: 0 0 0 0.25rem;
}

.btn-link:hover {
    color: var(--accent-primary);
}

/* Footer Styling */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: 1rem;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
}

.powered-by {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.powered-by a {
    color: var(--accent-primary);
    text-decoration: none;
    margin-left: 0.25rem;
}

.powered-by a:hover {
    text-decoration: underline;
}

/* Dark Mode Styles */
[data-theme="dark"] .controls-sidebar {
    background: var(--bg-primary);
    border-color: var(--border-light);
}

[data-theme="dark"] .blog-post {
    background: var(--bg-primary);
    border-color: var(--border-light);
}

[data-theme="dark"] .blog-header {
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] .blog-content h2 {
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] .blog-content blockquote {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

[data-theme="dark"] .history-item {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

[data-theme="dark"] .history-item:hover {
    background: var(--border-light);
}

[data-theme="dark"] .history-item-title {
    color: var(--text-primary);
}

[data-theme="dark"] .history-delete-btn {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="dark"] .history-delete-btn:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

[data-theme="dark"] .history-empty {
    color: var(--text-secondary);
}

[data-theme="dark"] .footer {
    background: var(--bg-primary);
    border-top-color: var(--border-light);
}

[data-theme="dark"] .ai-notice {
    background: rgba(234, 179, 8, 0.15);
    border-color: var(--warning);
}

[data-theme="dark"] .ai-notice p {
    color: var(--warning);
}

[data-theme="dark"] .ai-notice i {
    color: var(--warning);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .generator-layout {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 968px) {
    .generator-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 40vh 1fr;
        height: calc(100vh - 150px);
        gap: 0;
    }
    
    .controls-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        max-height: 40vh;
        overflow-y: auto;
    }
    
    .results-area {
        padding: 1rem;
        overflow-y: auto;
        justify-content: flex-start;
    }
    
    .blog-placeholder {
        padding: 2rem 1rem;
        min-height: 300px;
    }
    
    .blog-post {
        padding: 1.5rem;
    }
    
    .blog-post-title {
        font-size: 1.5rem;
    }
    
    .blog-content {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .generator-layout {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }
    
    .controls-sidebar {
        padding: 1rem;
    }
    
    .results-area {
        padding: 0.5rem;
    }
    
    .control-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .placeholder-features {
        gap: 1rem;
    }
    
    .blog-post {
        padding: 1rem;
    }
    
    .blog-post-title {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    .blog-content {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .blog-meta {
        gap: 0.5rem;
    }
    
    .blog-content h2 {
        font-size: 1.25rem;
    }
    
    .blog-content h3 {
        font-size: 1.1rem;
    }
}