/**
 * AI Dashboard - Public Styles
 */

.ai-dashboard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Notice */
.ai-dashboard-notice {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #2271b1;
    margin: 20px 0;
}

.ai-dashboard-notice.warning {
    border-color: #dba617;
}

/* Budget Summary */
.ai-dashboard-budget-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.budget-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.budget-card.main {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.budget-card.main h3 {
    margin: 0 0 10px;
    font-size: 14px;
    opacity: 0.9;
}

.budget-card.main .budget-amount {
    font-size: 48px;
    font-weight: 700;
}

.budget-card.main .budget-amount.exceeded {
    color: #ffcdd2;
}

.budget-card h4 {
    margin: 0 0 8px;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.budget-card span {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.budget-card small {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

.badge.danger {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Progress Bar */
.ai-dashboard-progress {
    margin: 30px 0;
}

.progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-fill.warning {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #f44336, #ff5722);
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

/* Provider Cards */
.ai-dashboard-providers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.provider-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.provider-card h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.provider-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.provider-stats span {
    font-size: 13px;
    color: #666;
}

.provider-cost {
    font-weight: 600;
    color: #2271b1 !important;
}

/* Actions */
.ai-dashboard-actions {
    display: flex;
    gap: 15px;
    margin: 30px 0;
}

.ai-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.ai-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.ai-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-btn.secondary {
    background: #f5f5f5;
    color: #333;
}

.ai-btn.secondary:hover {
    background: #e8e8e8;
}

/* Credit Products */
.ai-dashboard-topup {
    margin: 20px 0;
}

.credit-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.credit-product {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s;
}

.credit-product:hover {
    transform: translateY(-4px);
}

.credit-product h4 {
    margin: 0 0 15px;
    font-size: 18px;
}

.credit-value {
    margin: 15px 0;
}

.credit-amount {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
}

.credit-label {
    display: block;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}

.credit-price {
    margin: 15px 0;
    font-size: 20px;
    color: #333;
}

/* History */
.ai-dashboard-history {
    margin: 20px 0;
}

.history-filter {
    margin: 15px 0;
}

.history-filter select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.ai-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ai-dashboard-table th {
    background: #f5f5f5;
    padding: 12px 15px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

.ai-dashboard-table td {
    padding: 12px 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.ai-dashboard-table tr:hover td {
    background: #fafafa;
}

.provider-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.provider-badge.openai {
    background: #e8f5e9;
    color: #2e7d32;
}

.provider-badge.pinecone {
    background: #e3f2fd;
    color: #1565c0;
}

.provider-badge.twilio {
    background: #fce4ec;
    color: #c2185b;
}

.provider-badge.vapi {
    background: #fff3e0;
    color: #e65100;
}

.ai-dashboard-pagination {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 14px;
}

/* Subscription Status */
.subscription-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.subscription-status.active {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.subscription-status.inactive {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.subscription-status .plan-name {
    font-weight: 600;
    font-size: 16px;
}

.subscription-status .status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.subscription-status .status-badge.active {
    background: #4caf50;
    color: #fff;
}

.subscription-status .status-badge.expired {
    background: #f44336;
    color: #fff;
}

.subscription-status .expires {
    margin-left: auto;
    font-size: 13px;
    color: #666;
}

/* Budget Cards - New Types */
.budget-card.monthly {
    border-left: 4px solid #4caf50;
}

.budget-card.extra {
    border-left: 4px solid #ff9800;
}

.budget-card.stats {
    border-left: 4px solid #2196f3;
}

.budget-card .credit-amount {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.budget-card .credit-label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.mini-progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 10px 0 5px;
}

.mini-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 2px;
    transition: width 0.3s;
}

/* Pricing Page */
.ai-dashboard-pricing {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.pricing-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.pricing-card h3 {
    margin: 0 0 20px;
    font-size: 22px;
    color: #333;
}

.pricing-price {
    margin: 20px 0;
}

.pricing-price .woocommerce-Price-amount {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
}

.pricing-price .period {
    display: block;
    font-size: 14px;
    color: #999;
    margin-top: 5px;
}

.pricing-credit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.pricing-credit strong {
    font-size: 24px;
    display: block;
}

.pricing-credit span {
    font-size: 12px;
    opacity: 0.9;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.pricing-features li {
    padding: 8px 0 8px 25px;
    position: relative;
    font-size: 14px;
    color: #555;
}

.pricing-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
}

.ai-dashboard-info {
    text-align: center;
    margin-top: 20px;
}

.ai-dashboard-info a {
    color: #667eea;
    text-decoration: none;
}

.ai-dashboard-info a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .budget-card.main .budget-amount {
        font-size: 36px;
    }
    
    .ai-dashboard-actions {
        flex-direction: column;
    }
    
    .ai-dashboard-table {
        display: block;
        overflow-x: auto;
    }
    
    .subscription-status {
        flex-wrap: wrap;
    }
    
    .subscription-status .expires {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}
