/**
 * Text Panel CSS - Following Sidebar Panel Layout Blueprint
 * Professional text tools interface matching working panel patterns
 */

/* Base Panel Container - Following Blueprint Standard */
.text-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0;
    overflow-y: auto;
}

/* Panel Header */
.panel-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.panel-title i {
    color: #7c3aed;
    font-size: 14px;
}

/* Primary Action Button - Following Blueprint */
.btn-add-text-box {
    width: 100%;
    height: 40px;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.btn-add-text-box:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.btn-add-text-box:active {
    transform: translateY(0);
}

/* Panel Sections - Following Blueprint */
.panel-section {
    padding: 0 16px 24px;
}

.panel-section:first-of-type {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.section-header {
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* AI Content Card */
.ai-content-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.ai-content-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.3;
}

.ai-content-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 2px;
}

.ai-content-duration {
    font-size: 12px;
    color: #6b7280;
}

/* AI Based Content - Following Blueprint */
.ai-based-content {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #7c3aed;
    font-weight: 500;
}

.ai-based-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-refresh-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
    font-size: 12px;
}

.ai-refresh-btn:hover {
    color: #7c3aed;
}

/* Content Grids - Following Blueprint */
.text-styles-grid,
.list-styles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Content Items - Following Blueprint */
.text-style-card,
.list-style-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.text-style-card:hover,
.list-style-card:hover {
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
}

.text-style-card:active,
.list-style-card:active {
    transform: translateY(0);
}

/* Text Style Content */
.text-style-content,
.list-style-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.text-style-preview {
    text-align: center;
    line-height: 1.3;
    width: 100%;
}

.text-style-preview.headline {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.text-style-preview.subtitle {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.text-style-preview.paragraph {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* List Style Preview */
.list-style-preview {
    text-align: left;
    width: 100%;
}

.list-item {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
    margin-bottom: 2px;
}

.list-item:last-child {
    margin-bottom: 0;
}

/* Content Labels - Following Blueprint */
.text-style-label,
.list-style-label {
    font-size: 12px;
    font-weight: 500;
    color: #1f2937;
    text-align: center;
}

/* Interactive Section */
.interactive-content {
    text-align: center;
}

.interactive-description {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.4;
}

.interactive-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.interactive-btn {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.interactive-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.02);
}

.interactive-btn i {
    font-size: 12px;
}

/* Responsive Design - Following Blueprint */
@media (min-width: 1024px) {
    .text-styles-grid,
    .list-styles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .panel-section {
        padding: 0 16px 24px;
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .text-styles-grid,
    .list-styles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .panel-section {
        padding: 0 12px 20px;
    }
    
    .text-style-card,
    .list-style-card {
        min-height: 70px;
        padding: 10px;
    }
}

@media (max-width: 767px) {
    .text-styles-grid,
    .list-styles-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .panel-section {
        padding: 0 12px 16px;
    }
    
    .panel-section:first-of-type {
        padding: 12px;
    }
    
    .btn-add-text-box {
        height: 36px;
        font-size: 12px;
    }
    
    .text-style-card,
    .list-style-card {
        min-height: 60px;
        padding: 10px;
    }
    
    .interactive-actions {
        gap: 6px;
    }
    
    .interactive-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Theme Support - Following Blueprint */
[data-theme="dark"] .text-panel-content {
    background: #1f2937;
}

[data-theme="dark"] .panel-header {
    background: #1f2937;
    border-bottom-color: #374151;
}

[data-theme="dark"] .panel-title {
    color: #f9fafb;
}

[data-theme="dark"] .section-title {
    color: #f9fafb;
}

[data-theme="dark"] .ai-content-card {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .ai-content-title {
    color: #f9fafb;
}

[data-theme="dark"] .ai-content-meta,
[data-theme="dark"] .ai-content-duration {
    color: #d1d5db;
}

[data-theme="dark"] .text-style-card,
[data-theme="dark"] .list-style-card,
[data-theme="dark"] .interactive-btn {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .text-style-card:hover,
[data-theme="dark"] .list-style-card:hover {
    border-color: #7c3aed;
    background: #374151;
}

[data-theme="dark"] .text-style-preview.headline,
[data-theme="dark"] .text-style-label,
[data-theme="dark"] .list-style-label {
    color: #f9fafb;
}

[data-theme="dark"] .text-style-preview.subtitle {
    color: #e5e7eb;
}

[data-theme="dark"] .text-style-preview.paragraph,
[data-theme="dark"] .list-item {
    color: #d1d5db;
}

[data-theme="dark"] .interactive-description {
    color: #d1d5db;
}

[data-theme="dark"] .interactive-btn {
    color: #e5e7eb;
}

[data-theme="dark"] .interactive-btn:hover {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

/* Scrollbar Styling */
.text-panel-content::-webkit-scrollbar {
    width: 6px;
}

.text-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.text-panel-content::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
}

.text-panel-content::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Focus States for Accessibility */
.btn-add-text-box:focus,
.text-style-card:focus,
.list-style-card:focus,
.interactive-btn:focus,
.ai-refresh-btn:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* High Contrast Theme Support */
@media (prefers-contrast: high) {
    .text-style-card,
    .list-style-card,
    .interactive-btn {
        border-width: 2px;
    }
    
    .btn-add-text-box {
        border: 2px solid #1f2937;
    }
}

/* Reduce Motion Support */
@media (prefers-reduced-motion: reduce) {
    .text-style-card,
    .list-style-card,
    .btn-add-text-box,
    .interactive-btn,
    .ai-refresh-btn {
        transition: none;
    }
}

/* Animation Classes */
.text-style-card,
.list-style-card {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
