/* Routes (A/B Test) Index Page Styles */

/* Route Type Toggle */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.route-type-toggle {
    display: flex;
    background: #F3F4F6;
    border-radius: 6px;
    padding: 4px;
}

.route-type-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.route-type-btn.active {
    background: #1F2937;
    color: #FFFFFF;
}

.route-type-btn:hover:not(.active) {
    color: #374151;
}

/* Route Variation Card */
.route-variation-card {
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.route-variation-card.control {
    background: #D1FAE5;
    border-color: #6EE7B7;
}

.route-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.route-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
}

.route-badge.control {
    background: #10B981;
}

.route-badge.variation {
    background: #4F46E5;
}

.route-label-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.route-label-display {
    font-weight: 600;
    color: #374151;
}

.route-label-input {
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 600;
    width: 150px;
    display: none;
}

.btn-edit-label {
    background: transparent;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
}

.btn-edit-label:hover {
    color: #374151;
}

/* Device Toggle */
.device-toggle {
    display: flex;
    background: #E5E7EB;
    border-radius: 4px;
    padding: 2px;
    margin-left: auto;
}

.device-btn {
    padding: 4px 12px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.device-btn.active {
    background: #3B82F6;
    color: #FFFFFF;
}

.btn-remove-variation {
    background: transparent;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    margin-left: 8px;
}

.btn-remove-variation:hover {
    color: #EF4444;
}

/* URL Input Group */
.url-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.url-input-wrapper {
    flex: 1;
    position: relative;
}

.url-input {
    width: 100%;
    padding: 10px 12px;
    padding-right: 36px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
    background: #FFFFFF;
}

.url-input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-expand-params {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s;
}

/* URL Validation Styles */
.btn-validate-url {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: #F9FAFB;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-validate-url:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.btn-validate-url:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-validate-url.validating {
    color: #6B7280;
}

.btn-validate-url.valid {
    background: #D1FAE5;
    border-color: #10B981;
    color: #059669;
}

.btn-validate-url.invalid {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #DC2626;
}

.btn-validate-url.warning {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #D97706;
}

.btn-validate-url i.fa-spin {
    animation: spin 1s linear infinite;
}

.url-validation-status {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-validation-status.valid {
    color: #059669;
}

.url-validation-status.invalid {
    color: #DC2626;
}

.url-validation-status.warning {
    color: #D97706;
}

.url-validation-status i {
    font-size: 12px;
    display: none;
}

.url-input.valid {
    border-color: #10B981;
}

.url-input.invalid {
    border-color: #EF4444;
}

.url-input.warning {
    border-color: #F59E0B;
}

.btn-expand-params.expanded {
    transform: translateY(-50%) rotate(180deg);
}

.percentage-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.percentage-input {
    width: 60px;
    padding: 10px 8px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    background: #D1FAE5;
    font-weight: 600;
}

.percentage-input:focus {
    outline: none;
    border-color: #4F46E5;
}

.percentage-symbol {
    font-weight: 600;
    color: #374151;
    background: #D1FAE5;
    padding: 10px 8px;
    border-radius: 6px;
}

/* Query Parameters Section */
.query-params-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #D1D5DB;
    display: none;
}

.query-params-section.expanded {
    display: block;
}

.query-params-header {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.param-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.param-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    font-size: 13px;
}

.param-input:focus {
    outline: none;
    border-color: #4F46E5;
}

.btn-remove-param {
    background: #1F2937;
    border: none;
    color: #FFFFFF;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-param:hover {
    background: #374151;
}

.btn-add-param {
    background: #D9F99D;
    border: none;
    color: #365314;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 4px;
}

.btn-add-param:hover {
    background: #BEF264;
}

/* Route Footer */
.route-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

.total-percentage {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.percentage-value {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    padding: 4px 8px;
    background: #D1FAE5;
    border-radius: 4px;
    font-weight: 700;
}

.percentage-value.invalid {
    background: #FEE2E2;
    color: #DC2626;
}

.percentage-totals {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.total-percentage .device-label {
    font-size: 12px;
    color: #6B7280;
    margin-right: 4px;
}

/* Modal Sizes */
.modal-lg {
    max-width: 800px;
}

.modal-sm {
    max-width: 400px;
}

/* Form Section */
.form-section {
    margin-bottom: 24px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 8px;
}

.input-group .form-input {
    flex: 1;
}

.btn-icon {
    padding: 0 12px;
    height: 42px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #E5E7EB;
    color: #374151;
}

/* Badge Styles for Grid */
.badge-web {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-text {
    background: #F3E8FF;
    color: #6B21A8;
}

.badge-active {
    background: #D1FAE5;
    color: #065F46;
}

.badge-disabled {
    background: #FEE2E2;
    color: #991B1B;
}

/* Persist Cookie Group - Inline Layout */
.persist-cookie-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.duration-toggle-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.duration-btn {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.duration-btn:hover {
    border-color: #4F46E5;
    background: #F5F3FF;
}

.duration-btn.active {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #4F46E5;
}

/* Improved Description Textarea */
.description-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    background: #FAFAFA;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.description-textarea:focus {
    outline: none;
    border-color: #4F46E5;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.description-textarea::placeholder {
    color: #9CA3AF;
}

/* Alert Modal Styles */
#alertModal .modal-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 8px;
    position: relative;
}

#alertModal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

.alert-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.alert-icon-wrapper.error {
    background: #FEE2E2;
    color: #DC2626;
}

.alert-icon-wrapper.warning {
    background: #FEF3C7;
    color: #D97706;
}

.alert-icon-wrapper.success {
    background: #D1FAE5;
    color: #059669;
}

.alert-icon-wrapper.info {
    background: #DBEAFE;
    color: #2563EB;
}

.alert-icon-wrapper i {
    font-size: 24px;
}

#alertModal .modal-title {
    margin: 0;
    font-size: 18px;
}

.alert-message {
    text-align: center;
    color: #4B5563;
    line-height: 1.6;
    white-space: pre-line;
    margin: 0;
}

.alert-footer {
    justify-content: center;
    border-top: none;
    padding-top: 8px;
}

.alert-footer .btn {
    min-width: 100px;
}
