/* Company Settings Styles */

/* Inline sub-navigation layout */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.settings-subnav {
    position: sticky;
    top: 16px; /* within page container */
    align-self: start;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 12px;
    /* Ensure long menus remain usable on smaller displays */
    max-height: calc(100vh - 120px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-subnav-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.settings-subnav a.settings-subnav-link {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    border: 1px solid transparent;
    margin: 2px 0;
    font-size: 14px;
}

.settings-subnav a.settings-subnav-link:hover {
    background: var(--primary-silver);
}

.settings-subnav a.settings-subnav-link.active {
    border-color: var(--primary-cyan);
    background: rgba(0,178,204,0.08);
    color: var(--text-dark);
}

.settings-subnav a.settings-subnav-link.sub {
    padding-left: 18px;
    font-size: 13px;
}

.settings-content {
    min-width: 0; /* prevent overflow */
}

@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
    .settings-subnav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
    }
    .settings-subnav a.settings-subnav-link {
        display: inline-block;
        padding: 6px 10px;
    }
}

/* Page Header Enhancements */
.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Form Layout */
.form-grid {
    display: grid;
    gap: 1rem;
}

/* Logo Upload Section */
.logo-upload-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.current-logo {
    flex-shrink: 0;
}

.logo-placeholder {
    width: 200px;
    height: 100px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    color: #6c757d;
}

.logo-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.logo-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.logo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Color Picker Section */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.color-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-picker:hover {
    transform: scale(1.05);
}

.color-hex {
    width: 100px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    text-align: center;
}

/* Integration Setup */
.integration-setup {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.integration-icon {
    flex-shrink: 0;
}

.integration-content {
    flex: 1;
}

.integration-content h4 {
    margin: 0 0 0.5rem 0;
    color: #212529;
}

.integration-content p {
    margin: 0 0 1rem 0;
    color: #6c757d;
}

.integration-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.benefit-item {
    font-size: 0.875rem;
    color: #28a745;
    font-weight: 500;
}

/* Azure Status */
.integration-status {
    display: flex;
    align-items: center;
}

.azure-status-connected {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.azure-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Security Toggles */
.security-toggles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.security-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.toggle-info {
    flex: 1;
}

.toggle-info h5 {
    margin: 0 0 0.25rem 0;
    color: #212529;
    font-size: 1rem;
}

.toggle-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #00B2CC;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Disabled (Not Yet Implemented) Sections */
.disabled-section {
    opacity: 0.55;
    pointer-events: none;
    filter: grayscale(15%);
}

.disabled-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 6px;
}

/* Setup Modal */
.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setup-step {
    display: none;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.setup-step.active {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-number {
    width: 32px;
    height: 32px;
    background: #00B2CC;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin: 0 0 0.5rem 0;
    color: #212529;
}

.step-content p {
    margin: 0 0 1rem 0;
    color: #6c757d;
}

/* Card Header Actions */
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form Help */
.form-help {
    margin-top: 0.5rem;
}

.form-help small {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Checkbox Groups */
.checkbox-group {
    margin: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #495057;
}

.checkbox {
    margin: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #dee2e6;
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox:checked + .checkmark {
    background: #00B2CC;
    border-color: #00B2CC;
}

.checkbox:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

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

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

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .color-picker-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .integration-benefits {
        grid-template-columns: 1fr;
    }
    
    .azure-actions {
        flex-direction: column;
    }
    
    .azure-actions .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    
    .color-picker-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-upload-section {
        flex-direction: column;
        text-align: center;
    }
    
    .integration-setup {
        flex-direction: column;
        text-align: center;
    }
    
    .security-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .page-header-actions .btn {
        width: 100%;
    }
}

/* Animation for unsaved changes indicator */
@keyframes pulse-save {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 178, 204, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 178, 204, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 178, 204, 0);
    }
}

#saveAllSettings {
    animation: pulse-save 2s infinite;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #00B2CC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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