/**
 * ServiceTitan Catalog Sync UI - Styles
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1C6172 0%, #519F45 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 40px;
    max-width: 900px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
    font-weight: 500;
}

.status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status.running {
    background: #bee3f8;
    color: #2c5282;
}

.status.success {
    background: #c6f6d5;
    color: #22543d;
}

.status.error {
    background: #fed7d7;
    color: #742a2a;
}

.results {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.results .success-msg {
    color: #519F45;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 15px;
}

.results p {
    color: #4a5568;
    margin: 8px 0;
    font-size: 16px;
}

.results span {
    font-weight: 600;
    color: #2d3748;
}

#error-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

#error-details h3 {
    color: #c53030;
    font-size: 14px;
    margin-bottom: 10px;
}

#error-list {
    background: #fff5f5;
    color: #742a2a;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
}

button {
    width: 100%;
    padding: 15px 22px;
    background: #1C6172;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    background: #165159;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 97, 114, 0.3);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #6c757d;
}

/* Preview Section Styles */
#preview-section {
    margin: 20px 0;
}

#preview-section h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 20px;
    font-weight: 600;
}

.preview-summary {
    background: #edf2f7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.preview-summary p {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 10px;
}

.preview-summary ul {
    list-style: none;
    padding-left: 0;
}

.preview-summary li {
    color: #4a5568;
    padding: 5px 0;
    font-size: 15px;
}

.preview-items {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.preview-item {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #1C6172;
}

.preview-item.retires {
    border-left-color: #e53e3e;
}

.hw-item-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.hw-item-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hw-item-title h3 {
    color: #2d3748;
    font-size: 18px;
    margin: 0;
}

.category-badge {
    background: #39A7D3;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.hw-item-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.hw-item-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
}

.override-input {
    width: 80px;
    padding: 6px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.override-input:focus {
    outline: none;
    border-color: #1C6172;
    box-shadow: 0 0 0 3px rgba(28, 97, 114, 0.1);
}

.override-input::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.override-input:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.preview-item.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.preview-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #e2e8f0;
    border-top-color: #1C6172;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.operation-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.service-entry.create .operation-badge {
    background: #c6f6d5;
    color: #22543d;
}

.service-entry.update .operation-badge {
    background: #bee3f8;
    color: #2c5282;
}

.service-entry.retire .operation-badge {
    background: #fed7d7;
    color: #742a2a;
}

.service-name {
    flex: 1;
    color: #2d3748;
    font-size: 14px;
}

.service-price {
    color: #1C6172;
    font-weight: 600;
    font-size: 14px;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group button {
    flex: 1;
}

button.primary {
    background: #519F45;
}

button.primary:hover:not(:disabled) {
    background: #418536;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(81, 159, 69, 0.3);
}

/* Environment Switcher */
.environment-switcher {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.env-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.toggle-container {
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 4px;
}

.env-toggle {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.env-toggle:hover {
    color: #2d3748;
}

.env-toggle.active {
    background: white;
    color: #1C6172;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
