/**
 * All-in-One Tools Hub - Premium Feature Styles
 * Pricing tables, premium badges, upgrade prompts,
 * premium user dashboard, watermarks, and tool overlays.
 */

/* ============================================
   1. PREMIUM BADGE
   ============================================ */
.aiot-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
    line-height: 1.5;
}

.aiot-premium-badge::before {
    content: '\2726';
    font-size: 0.625rem;
}

/* ============================================
   2. UPGRADE PROMPTS
   ============================================ */
.aiot-upgrade-prompt {
    position: relative;
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 50%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    overflow: hidden;
}

.aiot-upgrade-prompt::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at top right, rgba(251, 191, 36, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.aiot-upgrade-prompt-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    position: relative;
}

.aiot-upgrade-prompt h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.5rem;
    position: relative;
}

.aiot-upgrade-prompt p {
    color: #a16207;
    font-size: 0.9375rem;
    max-width: 500px;
    margin: 0 auto 1.25rem;
    position: relative;
}

.aiot-upgrade-prompt .aiot-upgrade-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    transition: all 0.2s ease;
    position: relative;
}

.aiot-upgrade-prompt .aiot-upgrade-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    color: #fff;
    text-decoration: none;
}

/* Inline upgrade prompt (compact) */
.aiot-upgrade-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #92400e;
}

.aiot-upgrade-inline a {
    color: #d97706;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
}

.aiot-upgrade-inline a:hover { color: #b45309; }

/* ============================================
   3. PRICING TABLE
   ============================================ */
.aiot-pricing-section { padding: 3rem 0; }

.aiot-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.aiot-pricing-card {
    position: relative;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.aiot-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Featured / popular plan */
.aiot-pricing-card--featured {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px #6366f1, 0 15px 40px rgba(99, 102, 241, 0.15);
    transform: scale(1.04);
    z-index: 1;
}

.aiot-pricing-card--featured:hover {
    transform: scale(1.04) translateY(-4px);
    box-shadow: 0 0 0 1px #6366f1, 0 25px 50px rgba(99, 102, 241, 0.2);
}

.aiot-pricing-popular-tag {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 9999px;
    white-space: nowrap;
}

.aiot-pricing-card-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.75rem;
}

.aiot-pricing-card-price {
    margin-bottom: 1.5rem;
}

.aiot-pricing-card-price .currency {
    font-size: 1.25rem;
    font-weight: 700;
    color: #334155;
    vertical-align: top;
    line-height: 1;
}

.aiot-pricing-card-price .amount {
    font-size: 3rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.aiot-pricing-card-price .period {
    font-size: 0.875rem;
    color: #94a3b8;
    display: block;
    margin-top: 0.25rem;
}

.aiot-pricing-card-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.aiot-pricing-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    text-align: left;
    flex: 1;
}

.aiot-pricing-card-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.aiot-pricing-card-features li:last-child { border-bottom: none; }

.aiot-pricing-card-features .check {
    color: #22c55e;
    font-weight: 700;
    flex-shrink: 0;
}

.aiot-pricing-card-features .cross {
    color: #cbd5e1;
    font-weight: 700;
    flex-shrink: 0;
}

.aiot-pricing-card-cta {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.aiot-pricing-card-cta--primary {
    background: #6366f1;
    color: #fff;
}

.aiot-pricing-card-cta--primary:hover {
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    text-decoration: none;
}

.aiot-pricing-card-cta--secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.aiot-pricing-card-cta--secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
    text-decoration: none;
}

/* ============================================
   4. BILLING TOGGLE
   ============================================ */
.aiot-billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
    color: #475569;
}

.aiot-billing-toggle-label { font-weight: 500; }

.aiot-billing-toggle-label.active { color: #6366f1; font-weight: 700; }

.aiot-billing-toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: #cbd5e1;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.aiot-billing-toggle-switch.active { background: #6366f1; }

.aiot-billing-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.aiot-billing-toggle-switch.active::after {
    transform: translateX(24px);
}

.aiot-billing-save {
    font-size: 0.75rem;
    font-weight: 700;
    color: #059669;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 9999px;
}

/* ============================================
   5. PREMIUM FEATURE CARDS
   ============================================ */
.aiot-features-premium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.aiot-feature-premium-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.aiot-feature-premium-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: #c7d2fe;
}

.aiot-feature-premium-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #6366f1;
}

.aiot-feature-premium-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.375rem;
}

.aiot-feature-premium-card p {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.6;
}

/* ============================================
   6. PREMIUM DASHBOARD ELEMENTS
   ============================================ */
.aiot-dashboard-premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    margin-bottom: 1.5rem;
}

.aiot-dashboard-premium-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #5b21b6;
}

.aiot-dashboard-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 4px 12px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
}

.aiot-usage-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.aiot-usage-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
}

.aiot-usage-bar-fill--warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.aiot-usage-bar-fill--danger  { background: linear-gradient(90deg, #ef4444, #dc2626); }

.aiot-usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.375rem;
}

/* ============================================
   7. WATERMARK OVERLAY
   ============================================ */
.aiot-watermark-overlay {
    position: relative;
}

.aiot-watermark-overlay::after {
    content: 'FREE';
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 4px 14px;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 5;
}

/* ============================================
   8. PREMIUM TOOL OVERLAY (locked tools)
   ============================================ */
.aiot-tool-locked-overlay {
    position: relative;
}

.aiot-tool-locked-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: inherit;
    z-index: 10;
    cursor: pointer;
    transition: background 0.2s ease;
}

.aiot-tool-locked-overlay:hover::before {
    background: rgba(255, 255, 255, 0.65);
}

.aiot-tool-locked-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    text-align: center;
    pointer-events: none;
}

.aiot-tool-locked-message .lock-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.aiot-tool-locked-message p {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.375rem;
}

.aiot-tool-locked-message span {
    font-size: 0.8125rem;
    color: #64748b;
}

/* ============================================
   9. GATEWAY SELECTOR (payment modal)
   ============================================ */
.aiot-gateway-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.aiot-gateway-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aiot-gateway-option:hover {
    border-color: #c7d2fe;
    background: #f5f3ff;
}

.aiot-gateway-option.selected {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.aiot-gateway-option-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
}

/* ============================================
   10. RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .aiot-pricing-card--featured { transform: none; }
    .aiot-pricing-card--featured:hover { transform: translateY(-4px); }

    .aiot-pricing-grid { gap: 1rem; }
    .aiot-pricing-card { padding: 1.5rem 1.25rem; }
    .aiot-pricing-card-price .amount { font-size: 2.5rem; }

    .aiot-upgrade-prompt { padding: 1.5rem 1rem; }

    .aiot-dashboard-premium-header {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .aiot-pricing-grid { grid-template-columns: 1fr; }
}
