/* AI Settings Page Styling */

/* Page Header */
.page-header h2 {
    color: #2c3e50;
    font-weight: 600;
}

.page-header .text-muted {
    font-size: 0.95rem;
}

/* Card Styling */
.card {
    border: 1px solid #e3e6f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 1rem 1.25rem;
    border-radius: 8px 8px 0 0 !important;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Alert Styling */
.alert-info {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Form Control Enhancements */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.input-group .btn-outline-secondary {
    border-color: #ced4da;
}

.input-group .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

/* Form Text (Help Text) */
.form-text {
    color: #6c757d;
    font-size: 0.875rem;
}

.form-text a {
    color: #667eea;
    text-decoration: none;
}

.form-text a:hover {
    text-decoration: underline;
}

/* Range Input Styling */
.form-range {
    height: 8px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    outline: none;
}

.form-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Feature Toggle List */
.feature-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.feature-toggle-item:hover {
    background-color: #e9ecef;
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.feature-toggle-item .fw-semibold {
    font-size: 1rem;
    color: #2c3e50;
}

.feature-toggle-item .text-muted {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Form Switch Enhancement */
.form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
    border: 2px solid #ced4da;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Metric Cards */
.metric-card {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    border: 1px solid #e3e6f0;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Usage Breakdown */
.usage-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.usage-item {
    display: grid;
    grid-template-columns: 1fr 3fr auto;
    align-items: center;
    gap: 0.75rem;
}

.usage-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.usage-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: #667eea;
    min-width: 30px;
    text-align: right;
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-outline-secondary {
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

/* Loading Spinner */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Help Card Links */
.card-body ul {
    margin: 0;
    padding: 0;
}

.card-body ul li a {
    color: #667eea;
    transition: color 0.2s ease;
}

.card-body ul li a:hover {
    color: #764ba2;
}

/* Responsive Design */
@media (max-width: 991px) {
    .page-header .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-header .d-flex > div:last-child {
        width: 100%;
    }
    
    .page-header button {
        width: 100%;
    }
    
    .col-lg-8,
    .col-lg-4 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 767px) {
    .metric-card {
        padding: 1rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .feature-toggle-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .usage-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .usage-bar {
        grid-column: 1 / -1;
    }
    
    .usage-count {
        text-align: left;
    }
}

/* Print Styles */
@media print {
    .btn,
    .form-check-input {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .card-header {
        background: #f8f9fa !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Animation for card entrance */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

.card:nth-child(1) {
    animation-delay: 0s;
}

.card:nth-child(2) {
    animation-delay: 0.05s;
}

.card:nth-child(3) {
    animation-delay: 0.1s;
}

/* Success/Error Message Animation */
.alert {
    animation: fadeIn 0.3s ease-out;
}

/* API Key Input Group */
.input-group > .form-control {
    border-right: none;
}

.input-group > .btn {
    border-left: none;
}

/* Focus State for Input Group */
.input-group:focus-within .form-control,
.input-group:focus-within .btn {
    border-color: #667eea;
}

/* Tooltip Enhancement (if using Bootstrap tooltips) */
.tooltip-inner {
    background-color: #2c3e50;
    font-size: 0.875rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #2c3e50;
}

.tooltip.bs-tooltip-right .tooltip-arrow::before {
    border-right-color: #2c3e50;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #2c3e50;
}

.tooltip.bs-tooltip-left .tooltip-arrow::before {
    border-left-color: #2c3e50;
}
