/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.login-box h2 {
    font-size: 18px;
    margin-bottom: 24px;
    color: #7f8c8d;
    font-weight: normal;
}

/* Dashboard */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e1e8ed;
}

.dashboard-header h1 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 4px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    color: #7f8c8d;
    font-size: 14px;
}

/* Configuration Sections */
.config-section {
    background: white;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.config-section h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.section-description {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 24px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
}

/* Slider */
.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
}

.threshold-info {
    margin-top: 8px;
    color: #7f8c8d;
}

/* Routing Rules and Carrier Mapping */
.routing-rule,
.carrier-mapping {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.rule-fields {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 1fr auto;
    gap: 12px;
    align-items: center;
}

.mapping-fields {
    display: grid;
    grid-template-columns: 2fr 2fr auto auto;
    gap: 12px;
    align-items: center;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #5a6a7a;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.empty-state {
    color: #7f8c8d;
    font-style: italic;
    padding: 16px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
}

/* Error Page */
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.error-box {
    text-align: center;
    max-width: 500px;
}

.error-box h1 {
    font-size: 72px;
    color: #e74c3c;
    margin-bottom: 16px;
}

.error-box h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 16px;
}

.error-box p {
    color: #7f8c8d;
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .rule-fields,
    .mapping-fields {
        grid-template-columns: 1fr;
    }

    .config-section {
        padding: 20px;
    }
}
