/* Claude AI Layout CSS - REDESIGNED: Compact Config Panel */

/* Main Dashboard Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-6);
    min-height: calc(100vh - 72px);
}

/* Two Column Dashboard Layout */
.dashboard-main {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    align-items: start;
}

/* Configuration Panel (Left Column) - REDESIGNED */
.config-panel {
    position: sticky;
    top: calc(72px + var(--space-4));
    height: fit-content;
    max-height: calc(100vh - 72px - var(--space-8));
    overflow-y: auto;
}

.panel-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-5); /* Reduced from space-8 */
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.panel-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Panel Header - COMPACT */
.panel-header {
    margin-bottom: var(--space-4); /* Reduced from space-8 */
    text-align: center;
    padding-bottom: var(--space-3); /* Reduced from space-6 */
    border-bottom: 1px solid var(--gray-100);
}

.panel-header h2 {
    font-size: var(--text-xl); /* Reduced from text-2xl */
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-1); /* Reduced from space-2 */
    line-height: var(--leading-tight);
}

.panel-header p {
    font-size: var(--text-xs); /* Reduced from text-sm */
    color: var(--gray-600);
    line-height: var(--leading-normal);
}

/* Configuration Sections - COMPACT */
.config-section {
    margin-bottom: var(--space-4); /* Reduced from space-6 */
}

.section-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2); /* Reduced from space-3 */
    font-size: var(--text-xs); /* Reduced from text-sm */
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.label-icon {
    font-size: 14px; /* Reduced from 16px */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* REDESIGNED: Compact Selection Buttons */
.selection-btn {
    width: 100%;
    padding: var(--space-2) var(--space-3); /* Dramatically reduced */
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    position: relative;
    overflow: hidden;
    min-height: 48px; /* Set minimum height instead of large padding */
}

.selection-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(238, 119, 35, 0.03), transparent);
    transition: left var(--transition-normal);
}

.selection-btn:hover::before {
    left: 100%;
}

.selection-btn:hover {
    border-color: var(--orange-300);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.selection-btn.selected {
    border-color: var(--orange-400);
    background: var(--orange-25, #fefaf8);
    box-shadow: var(--shadow-sm);
}

.selection-content {
    display: flex;
    align-items: center;
    gap: var(--space-2); /* Reduced from space-3 */
    flex: 1;
    min-width: 0;
}

.selection-icon {
    width: 18px; /* Reduced from 24px */
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    flex-shrink: 0;
    font-size: 14px; /* Smaller icons */
}

.selection-btn.selected .selection-icon {
    color: var(--orange-600);
}

.selection-text {
    display: flex;
    flex-direction: column;
    gap: 1px; /* Very tight spacing */
    min-width: 0;
    flex: 1;
}

.selection-title {
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    font-size: var(--text-xs); /* Reduced from text-sm */
    line-height: var(--leading-tight);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selection-desc {
    font-size: 11px; /* Very small secondary text */
    color: var(--gray-500);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selection-arrow {
    color: var(--gray-400);
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.selection-btn:hover .selection-arrow {
    color: var(--orange-500);
}

.selection-btn.open .selection-arrow {
    transform: rotate(180deg);
}

/* REDESIGNED: Compact Selected Display */
.selected-display {
    background: linear-gradient(135deg, var(--orange-25, #fefaf8), var(--orange-50));
    border: 1px solid var(--orange-200);
    border-radius: var(--radius-lg);
    padding: var(--space-2); /* Much smaller padding */
    margin-bottom: var(--space-3); /* Reduced spacing */
    animation: fadeInScale 0.2s ease-out;
}

.selected-header {
    display: flex;
    align-items: center;
    gap: var(--space-2); /* Reduced gap */
}

.selected-icon {
    width: 24px; /* Reduced from 32px */
    height: 24px;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--orange-300);
    font-size: 12px; /* Smaller icon */
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.selected-info {
    flex: 1;
    min-width: 0;
}

.selected-name {
    font-size: var(--text-xs); /* Reduced */
    font-weight: var(--font-semibold);
    color: var(--orange-800);
    line-height: var(--leading-tight);
    margin-bottom: 1px;
}

.selected-desc {
    font-size: 10px; /* Very small */
    color: var(--orange-600);
    line-height: var(--leading-normal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.change-btn {
    background: var(--orange-500);
    color: white;
    border: none;
    padding: var(--space-1) var(--space-2); /* Smaller button */
    border-radius: var(--radius-md);
    font-size: 10px; /* Tiny text */
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.change-btn:hover {
    background: var(--orange-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* REDESIGNED: Compact Generate Section */
.generate-section {
    margin: var(--space-4) 0; /* Reduced margins */
}

.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: white;
    border: none;
    padding: var(--space-3) var(--space-4); /* Reduced padding */
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-2); /* Reduced gap */
    font-size: var(--text-sm); /* Smaller text */
    font-weight: var(--font-semibold);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    min-height: 48px; /* Compact height */
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left var(--transition-normal);
}

.generate-btn:hover:not(:disabled)::before {
    left: 100%;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.generate-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.generate-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex: 1;
}

.generate-title {
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    line-height: var(--leading-tight);
}

.generate-subtitle {
    font-size: 10px; /* Smaller subtitle */
    opacity: 0.8;
    font-weight: var(--font-normal);
}

/* REDESIGNED: Compact Live Stats */
.live-stats {
    background: var(--gray-25);
    border-radius: var(--radius-lg);
    padding: var(--space-2); /* Much smaller padding */
    margin-top: var(--space-3); /* Reduced margin */
    border: 1px solid var(--gray-100);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-1); /* Tighter spacing */
}

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

.stat-label {
    font-size: 10px; /* Smaller text */
    color: var(--gray-600);
    font-weight: var(--font-medium);
}

.stat-value {
    font-size: 10px; /* Smaller text */
    color: var(--gray-800);
    font-weight: var(--font-semibold);
    max-width: 60%;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Writing Studio (Right Column) - UNCHANGED */
.writing-studio {
    min-height: 600px;
    position: sticky;
    top: calc(72px + var(--space-6));
    height: fit-content;
    max-height: calc(100vh - 72px - var(--space-12));
}

.studio-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 72px - var(--space-12));
    max-height: calc(100vh - 72px - var(--space-12));
    transition: all var(--transition-normal);
}

.studio-card:hover {
    box-shadow: var(--shadow-xl);
}

/* Content Gallery (History) - UNCHANGED */
.content-gallery {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.content-gallery:hover {
    box-shadow: var(--shadow-xl);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--gray-100);
}

.gallery-title h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.gallery-title p {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-main {
        grid-template-columns: 350px 1fr;
        gap: var(--space-5);
    }
    
    .panel-card {
        padding: var(--space-4);
    }
}

@media (max-width: 1024px) {
    .dashboard-main {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
    
    .config-panel {
        position: static;
        order: 1;
        max-height: none;
    }
    
    .writing-studio {
        order: 2;
        position: static;
        max-height: none;
    }
    
    .studio-card {
        height: auto;
        max-height: none;
        min-height: 500px;
    }
    
    .dashboard-container {
        padding: var(--space-5) var(--space-4);
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: var(--space-4) var(--space-3);
    }
    
    .panel-card,
    .content-gallery {
        padding: var(--space-4);
        border-radius: var(--radius-xl);
    }
    
    .studio-card {
        border-radius: var(--radius-xl);
        min-height: 450px;
    }
    
    .dashboard-main {
        gap: var(--space-4);
        margin-bottom: var(--space-6);
    }
    
    .generate-btn {
        padding: var(--space-3);
        flex-direction: column;
        text-align: center;
        gap: var(--space-1);
    }
    
    .generate-text {
        text-align: center;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .selection-btn {
        padding: var(--space-2);
    }
    
    .selected-display {
        padding: var(--space-2);
    }
    
    .selected-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    
    .change-btn {
        align-self: stretch;
        text-align: center;
        padding: var(--space-2);
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: var(--space-3);
    }
    
    .panel-card,
    .content-gallery {
        padding: var(--space-3);
    }
    
    .generate-section {
        margin: var(--space-3) 0;
    }
    
    .selection-content {
        gap: var(--space-1);
    }
    
    .selection-icon {
        width: 16px;
        height: 16px;
        font-size: 12px;
    }
    
    .selected-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* High performance optimizations */
.panel-card,
.studio-card,
.content-gallery {
    contain: layout style paint;
}

.selection-btn,
.generate-btn {
    contain: layout style;
}

/* Print styles */
@media print {
    .dashboard-main {
        display: block;
    }
    
    .config-panel {
        display: none;
    }
    
    .writing-studio {
        position: static;
        max-height: none;
        height: auto;
    }
    
    .studio-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
        height: auto;
        max-height: none;
    }
}

.byok-guide-notice {
    font-size: var(--text-xs);
    color: var(--orange-600);
    text-align: center;
    text-decoration: none; 
    font-weight: 600;
}

.byok-guide-notice.hidden {
    display: none;
}