/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Progress and assignment info */
.progress-text {
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.95;
}

.progress-subtext {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.progress-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Assignment status */
.assignment-status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
}

.assignment-status.existing {
    background-color: #e7f3ff;
    color: #0056b3;
    border: 1px solid #b8daff;
}

.assignment-status.new {
    background-color: #e8f5e8;
    color: #155724;
    border: 1px solid #b8e6b8;
}

/* Session info */
.session-info {
    margin-top: 1rem;
    text-align: center;
    color: #6c757d;
}

.session-info code {
    background-color: #f8f9fa;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Main content */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* Cluster header */
.cluster-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cluster-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.cluster-count {
    color: #6c757d;
    font-weight: normal;
    font-size: 1rem;
}

.cluster-description {
    color: #6c757d;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Companies table */
.companies-table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.companies-table {
    width: 100%;
    border-collapse: collapse;
}

.companies-table th {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

.companies-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.companies-table tr:hover {
    background-color: #f8f9fa;
}

.company-name {
    min-width: 200px;
}

.name-original {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.name-cleaned {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

.object-id code,
.acumatica-id code {
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: #495057;
}

.no-data {
    color: #adb5bd;
    font-style: italic;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-secondary {
    background-color: #e2e3e5;
    color: #495057;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
    transform: translateY(-1px);
}

.btn-success.handled {
    background-color: #155724;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-1px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Cluster actions */
.cluster-actions {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.action-help {
    margin-top: 1rem;
    color: #6c757d;
    font-size: 0.95rem;
}

/* Completion page */
.completion-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.completion-content {
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
}

.celebration-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.completion-title {
    font-size: 2.5rem;
    color: #28a745;
    margin-bottom: 1rem;
    font-weight: 700;
}

.completion-message {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.completion-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    text-align: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completion-help {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Error page */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.error-content {
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.error-details {
    text-align: left;
    margin-bottom: 2rem;
}

.error-details summary {
    cursor: pointer;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.error-details pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    overflow-x: auto;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Footer */
.footer {
    background-color: #343a40;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
}

.footer p {
    margin: 0;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    .progress-info {
        max-width: 100%;
    }
    
    .companies-table-container {
        overflow-x: auto;
    }
    
    .companies-table {
        min-width: 1000px;
    }
    
    .completion-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .error-actions {
        flex-direction: column;
    }
    
    .btn-large {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-small {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem 0;
    }
    
    .cluster-header,
    .cluster-actions {
        padding: 1rem;
    }
    
    .completion-content,
    .error-content {
        padding: 2rem 1.5rem;
    }
    
    .companies-table {
        min-width: 1200px;
    }
    
    .completion-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .btn-small {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
    }
} 