/*
 * Dashboard Multi-Tool - Custom CSS
 * Stili personalizzati per l'integrazione Cork v4.0.0
 * =====================================================
 */

/* =============================================
   TOKEN & PLAN BADGES
   ============================================= */

.token-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.token-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.token-badge svg {
    width: 16px;
    height: 16px;
}

.plan-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.plan-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.plan-badge-free {
    background: linear-gradient(135deg, #a8a8a8 0%, #6c757d 100%);
}

.plan-badge-basic {
    background: linear-gradient(135deg, #667eea 0%, #4361ee 100%);
}

.plan-badge-pro {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* =============================================
   TOKEN PROGRESS BAR
   ============================================= */

.token-progress {
    height: 30px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    overflow: hidden;
}

.token-progress .progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.6s ease;
}

.token-progress-low .progress-bar {
    background: linear-gradient(135deg, #e7515a 0%, #ff6b6b 100%);
}

.token-progress-medium .progress-bar {
    background: linear-gradient(135deg, #e2a03f 0%, #ffbb44 100%);
}

.token-progress-high .progress-bar {
    background: linear-gradient(135deg, #00ab55 0%, #009688 100%);
}

/* =============================================
   STAT CARDS (Dashboard)
   ============================================= */

.stat-card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .stat-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.stat-icon-primary { background: linear-gradient(135deg, #4361ee 0%, #667eea 100%); }
.stat-icon-success { background: linear-gradient(135deg, #00ab55 0%, #009688 100%); }
.stat-icon-warning { background: linear-gradient(135deg, #e2a03f 0%, #ffbb44 100%); }
.stat-icon-danger  { background: linear-gradient(135deg, #e7515a 0%, #ff6b6b 100%); }
.stat-icon-info    { background: linear-gradient(135deg, #2196f3 0%, #00bcd4 100%); }

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #888ea8;
    font-weight: 600;
}

.stat-card .stat-change {
    font-size: 12px;
    font-weight: 600;
}

.stat-change-up { color: #00ab55; }
.stat-change-down { color: #e7515a; }

/* =============================================
   TOOL CARDS
   ============================================= */

.tool-card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.tool-card .tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.tool-card .tool-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.tool-card .tool-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.tool-card .tool-description {
    font-size: 13px;
    color: #888ea8;
    line-height: 1.5;
}

.tool-card .tool-token-cost {
    font-size: 12px;
    font-weight: 600;
    color: #4361ee;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Tool Card - Locked State */
.tool-card-locked {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.tool-card-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    z-index: 1;
}

.tool-card-locked .lock-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-card-locked .lock-overlay svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* =============================================
   PRICING CARDS
   ============================================= */

.pricing-card {
    border: 2px solid #e0e6ed;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pricing-card.featured {
    border: 3px solid #4361ee;
}

.pricing-card.featured::before {
    content: 'POPOLARE';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4361ee 0%, #667eea 100%);
    color: white;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
}

.pricing-card .pricing-header {
    text-align: center;
    padding: 30px 20px 20px;
}

.pricing-card .pricing-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.pricing-card .pricing-price {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}

.pricing-card .pricing-price .currency {
    font-size: 20px;
    vertical-align: super;
}

.pricing-card .pricing-price .period {
    font-size: 14px;
    color: #888ea8;
    font-weight: 400;
}

.pricing-card .pricing-tokens {
    font-size: 14px;
    font-weight: 600;
    color: #4361ee;
    margin-bottom: 20px;
}

.pricing-card .pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-card .pricing-features li {
    padding: 10px 20px;
    border-top: 1px solid #e0e6ed;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-card .pricing-features li svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.pricing-card .pricing-features li.included svg {
    color: #00ab55;
}

.pricing-card .pricing-features li.excluded {
    color: #bfc9d4;
    text-decoration: line-through;
}

.pricing-card .pricing-features li.excluded svg {
    color: #bfc9d4;
}

.pricing-card .pricing-footer {
    padding: 20px;
    text-align: center;
}

.pricing-card .pricing-footer .btn {
    border-radius: 8px;
    padding: 10px 30px;
    font-weight: 600;
}

/* Current Plan Indicator */
.pricing-card.current-plan {
    border-color: #00ab55;
}

.pricing-card.current-plan::after {
    content: 'PIANO ATTUALE';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #00ab55;
    color: white;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* =============================================
   TOOL USAGE TABLE
   ============================================= */

.usage-table .badge-tool {
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

.usage-table .token-cost {
    font-weight: 700;
    color: #e2a03f;
}

/* =============================================
   TRANSACTION STATUS
   ============================================= */

.transaction-status {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.transaction-status-completed {
    background: rgba(0, 171, 85, 0.15);
    color: #00ab55;
}

.transaction-status-pending {
    background: rgba(226, 160, 63, 0.15);
    color: #e2a03f;
}

.transaction-status-failed {
    background: rgba(231, 81, 90, 0.15);
    color: #e7515a;
}

.transaction-status-refunded {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}

/* =============================================
   TEXT ANALYZER TOOL
   ============================================= */

.text-analyzer-input {
    border-radius: 12px;
    border: 2px solid #e0e6ed;
    transition: border-color 0.3s ease;
    min-height: 200px;
    font-size: 14px;
    line-height: 1.6;
}

.text-analyzer-input:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.text-analyzer-results .result-card {
    border: none;
    border-radius: 10px;
    text-align: center;
    padding: 20px 15px;
}

.text-analyzer-results .result-value {
    font-size: 32px;
    font-weight: 800;
    color: #4361ee;
    line-height: 1;
    margin-bottom: 5px;
}

.text-analyzer-results .result-label {
    font-size: 12px;
    color: #888ea8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Text Analyzer - Result Page */
.text-analyzer-results .card {
    transition: all 0.3s ease;
}

.text-analyzer-results .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.readability-gauge .gauge-label {
    font-size: 16px;
    color: #888ea8;
    font-weight: 600;
}

.readability-scale {
    position: relative;
    padding-bottom: 15px;
}

.sentiment-gauge svg {
    stroke-width: 1.5;
}

/* Keywords chart bar colors */
.apexcharts-bar-area {
    border-radius: 4px;
}

/* =============================================
   ADMIN PANEL
   ============================================= */

.admin-stat-card {
    border: none;
    border-radius: 12px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateX(5px);
}

.admin-stat-card.border-primary { border-left-color: #4361ee; }
.admin-stat-card.border-success { border-left-color: #00ab55; }
.admin-stat-card.border-warning { border-left-color: #e2a03f; }
.admin-stat-card.border-danger  { border-left-color: #e7515a; }
.admin-stat-card.border-info    { border-left-color: #2196f3; }
.admin-stat-card.border-secondary { border-left-color: #888ea8; }

/* Admin Report Charts */
.admin-report-kpi {
    font-size: 28px;
    font-weight: 700;
}

/* Admin Logs */
.admin-logs-filter .form-select,
.admin-logs-filter .form-control {
    border-radius: 8px;
}

/* Admin Settings */
.admin-settings .widget-content-area {
    border-radius: 12px;
}

.admin-settings .form-switch .form-check-input:checked {
    background-color: #4361ee;
    border-color: #4361ee;
}

/* =============================================
   USER PROFILE
   ============================================= */

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #e0e6ed;
    object-fit: cover;
}

.profile-plan-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
}

/* =============================================
   SIDEBAR CUSTOMIZATIONS
   ============================================= */

.sidebar-wrapper .menu-categories .menu .token-sidebar-info {
    padding: 15px 20px;
    margin: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    text-align: center;
}

.sidebar-wrapper .menu-categories .menu .token-sidebar-info .token-count {
    font-size: 24px;
    font-weight: 800;
}

.sidebar-wrapper .menu-categories .menu .token-sidebar-info .token-label {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================
   NOTIFICATIONS
   ============================================= */

.notification-item {
    border-bottom: 1px solid #e0e6ed;
    padding: 12px 16px;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item .notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item .notification-text {
    font-size: 13px;
    line-height: 1.4;
}

.notification-item .notification-time {
    font-size: 11px;
    color: #888ea8;
}

/* =============================================
   EMPTY STATES
   ============================================= */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: #bfc9d4;
    margin-bottom: 20px;
}

.empty-state h5 {
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    color: #888ea8;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* =============================================
   DARK MODE OVERRIDES
   ============================================= */

.dark .pricing-card {
    border-color: #191e3a;
    background: #0e1726;
}

.dark .pricing-card.featured {
    border-color: #4361ee;
}

.dark .pricing-card .pricing-features li {
    border-top-color: #191e3a;
}

.dark .tool-card-locked::after {
    background: rgba(14, 23, 38, 0.5);
}

.dark .text-analyzer-input {
    border-color: #191e3a;
    background: #0e1726;
    color: #bfc9d4;
}

.dark .text-analyzer-input:focus {
    border-color: #4361ee;
}

.dark .text-analyzer-results .card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.dark .readability-gauge .gauge-label {
    color: #515365;
}

.dark .profile-plan-info {
    background: linear-gradient(135deg, #0e1726 0%, #191e3a 100%);
}

.dark .notification-item:hover {
    background: #191e3a;
}

.dark .notification-item {
    border-bottom-color: #191e3a;
}

.dark .stat-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.dark .tool-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dark .pricing-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.dark .empty-state svg {
    color: #515365;
}

.dark .stat-card .stat-label,
.dark .tool-card .tool-description,
.dark .text-analyzer-results .result-label,
.dark .notification-item .notification-time,
.dark .empty-state p {
    color: #515365;
}

.dark .pricing-card .pricing-price .period {
    color: #515365;
}

.dark .pricing-card .pricing-features li.excluded {
    color: #3b3f5c;
}

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */

@media (max-width: 991px) {
    .token-badge,
    .plan-badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .pricing-card .pricing-price {
        font-size: 32px;
    }
}

@media (max-width: 575px) {
    .token-badge,
    .plan-badge {
        padding: 4px 8px;
        font-size: 11px;
    }

    .stat-card .stat-value {
        font-size: 20px;
    }

    .tool-card .tool-icon {
        width: 48px;
        height: 48px;
    }

    .text-analyzer-results .result-value {
        font-size: 24px;
    }

    .pricing-card .pricing-price {
        font-size: 28px;
    }

    .empty-state {
        padding: 40px 15px;
    }

    .empty-state svg {
        width: 60px;
        height: 60px;
    }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

.border-radius-12 { border-radius: 12px; }
.border-radius-16 { border-radius: 16px; }

.gradient-primary { background: linear-gradient(135deg, #4361ee 0%, #667eea 100%); }
.gradient-success { background: linear-gradient(135deg, #00ab55 0%, #009688 100%); }
.gradient-warning { background: linear-gradient(135deg, #e2a03f 0%, #ffbb44 100%); }
.gradient-danger  { background: linear-gradient(135deg, #e7515a 0%, #ff6b6b 100%); }
.gradient-info    { background: linear-gradient(135deg, #2196f3 0%, #00bcd4 100%); }
.gradient-purple  { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }

.text-gradient-primary {
    background: linear-gradient(135deg, #4361ee, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   AUTH PAGES (Login, Register, Forgot Password)
   ============================================= */

body.form.auth-dark {
    background: linear-gradient(135deg, #1a1c2e 0%, #0e1726 100%);
}

.auth-brand-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand-logo h1 {
    color: #4361ee;
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0;
}

.auth-brand-logo span {
    color: #e0e6ed;
}

.auth-card-dark {
    background: #1b2e4b;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.auth-card-dark h2 {
    color: #e0e6ed;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-card-dark p.subtitle {
    color: #888ea8;
    margin-bottom: 2rem;
}

.auth-card-dark .form-control {
    background: #0e1726;
    border: 1px solid #3b3f5c;
    color: #e0e6ed;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.auth-card-dark .form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.auth-card-dark .form-control::placeholder {
    color: #515365;
}

.auth-card-dark label {
    color: #888ea8;
    font-weight: 600;
    font-size: 0.875rem;
}

.auth-card-dark .form-check-label {
    color: #888ea8;
}

.auth-card-dark .btn-primary {
    background: #4361ee;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-weight: 700;
    width: 100%;
    transition: background 0.3s ease;
}

.auth-card-dark .btn-primary:hover {
    background: #3651d4;
}

.auth-card-dark .auth-links a {
    color: #4361ee;
    text-decoration: none;
}

.auth-card-dark .auth-links a:hover {
    text-decoration: underline;
}

.auth-card-dark .auth-links p {
    color: #888ea8;
    margin: 0;
}

.auth-alert-error {
    background: rgba(231, 81, 90, 0.15);
    border: 1px solid #e7515a;
    color: #e7515a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.auth-alert-success {
    background: rgba(0, 171, 85, 0.15);
    border: 1px solid #00ab55;
    color: #00ab55;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
