/* Mock Data Generator Tool Styles */

.mock-data-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.categories-panel {
    flex: 0 0 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: calc(100vh - 200px);
    position: sticky;
    top: 20px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
}

.categories-panel h2 {
    padding: 20px 20px 0 20px;
    margin: 0;
    background: white;
    border-radius: 8px 8px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.categories-panel #categoriesContainer {
    overflow-y: auto;
    padding: 0 20px 20px 20px;
    flex: 1;
}

.main-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Category Groups */
.category-group {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    cursor: pointer;
    background: linear-gradient(135deg, #f3f4f6 0%, #f9fafb 100%);
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.category-header:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
}

.category-header.collapsed {
    border-bottom: none;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.category-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
}

.category-icon.personal { background: #dbeafe; color: #1e40af; }
.category-icon.address { background: #dcfce7; color: #166534; }
.category-icon.company { background: #fef3c7; color: #92400e; }
.category-icon.internet { background: #e0e7ff; color: #3730a3; }
.category-icon.text { background: #fce7f3; color: #831843; }
.category-icon.datetime { background: #fed7aa; color: #9a3412; }
.category-icon.finance { background: #d1fae5; color: #065f46; }
.category-icon.file { background: #e9d5ff; color: #6b21a8; }
.category-icon.color { background: #fecaca; color: #991b1b; }
.category-icon.misc { background: #e2e8f0; color: #475569; }

.category-toggle {
    transition: transform 0.2s;
    color: #6b7280;
}

.category-toggle.collapsed {
    transform: rotate(-90deg);
}

.category-items {
    padding: 10px 15px;
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease-out;
}

.category-items.collapsed {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    transition: all 0.2s;
}

.category-item:hover {
    padding-left: 4px;
}

.category-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.category-item label {
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
    flex: 1;
}

/* Controls */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* Preview Section */
.preview-section {
    margin-top: 20px;
}

.preview-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.preview-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.preview-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.preview-content {
    display: none;
}

.preview-content.active {
    display: block;
}

.table-preview {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.table-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-preview th,
.table-preview td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #e5e7eb;
}

.table-preview th {
    background: #f9fafb;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.code-preview {
    background: #1f2937;
    color: #f3f4f6;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    max-height: 400px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.selected-count {
    background: #dbeafe;
    color: #1e40af;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin: 0 20px 15px 20px;
    position: sticky;
    top: 52px;
    z-index: 10;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-generate {
    background: #2563eb;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-generate:hover {
    background: #1d4ed8;
}

.btn-download {
    background: #059669;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #047857;
}

.btn-reset {
    background: #6b7280;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reset:hover {
    background: #4b5563;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .mock-data-container {
        flex-direction: column;
    }
    
    .categories-panel {
        flex: 1;
        max-height: none;
        position: relative;
        top: 0;
    }
    
    .selected-count {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .preview-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-preview {
        font-size: 12px;
    }
    
    .table-preview th,
    .table-preview td {
        padding: 6px 8px;
        min-width: 100px;
    }
    
    .code-preview {
        font-size: 11px;
    }
    
    .categories-panel h2 {
        font-size: 18px;
    }
    
    .category-item label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .categories-panel,
    .main-panel {
        padding: 15px;
        border-radius: 6px;
    }
    
    .category-header {
        padding: 10px 12px;
    }
    
    .category-items {
        padding: 8px 12px;
    }
    
    .control-group input,
    .control-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .loading-content {
        padding: 20px;
        margin: 0 15px;
    }
}
