/* Subscription Management Styles */

/* Subscription Badge in Header */
.subscription-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    color: white;
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.35);
    margin-right: 1rem;
}

.subscription-badge i {
    font-size: 1rem;
}

/* Subscription Card */
.subscription-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    border: 1px solid var(--border-color-light);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.subscription-card:hover {
    box-shadow: var(--shadow-lg);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.plan-info h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.plan-price {
    text-align: right;
}

.plan-price .currency {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.plan-price .amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.plan-price .period {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.subscription-details {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.detail-row .label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.detail-row .label i {
    color: var(--primary-color);
}

.detail-row .value {
    font-weight: 600;
    color: var(--text-primary);
}

.subscription-progress {
    margin-bottom: 2rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 50px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.4);
}

.subscription-features {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
}

.subscription-features h4 {
    margin-bottom: 1rem;
}

.subscription-features ul {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.subscription-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subscription-features li i {
    color: var(--success-color);
    font-size: 0.875rem;
}

/* No Subscription State */
.no-subscription {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.no-subscription h3 {
    margin: 0 0 0.5rem;
}

.no-subscription p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Usage Stats */
.usage-stats {
    display: grid;
    gap: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row strong {
    color: var(--primary-color);
    font-size: 1.125rem;
}

/* Quick Actions */
.quick-actions-list {
    display: grid;
    gap: 0.75rem;
}

.action-btn-full {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    width: 100%;
    text-align: left;
}

.action-btn-full:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.action-btn-full i {
    font-size: 1.25rem;
}

/* License Card */
.license-card {
    background: white;
    border: 2px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.license-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.license-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-colored);
}

.license-key-display {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.license-key-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.license-key-value {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.license-key-value code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    padding: 0;
}

.btn-copy {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.btn-copy:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.license-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

.license-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-danger-outline {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid var(--error-color);
    color: var(--error-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger-outline:hover {
    background: var(--error-color);
    color: white;
}

/* Device Card */
.device-card {
    background: white;
    border: 2px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.device-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.device-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.device-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.device-info {
    flex: 1;
}

.device-info h4 {
    margin: 0 0 0.25rem;
}

.device-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.device-details {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.device-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Sessions Table */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
}

.sessions-table thead {
    background: var(--bg-secondary);
}

.sessions-table th,
.sessions-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.sessions-table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.sessions-table tbody tr:hover {
    background: var(--bg-secondary);
}

.session-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-type i {
    color: var(--primary-color);
}

/* Loading/Empty States */
.subscription-loading,
.licenses-loading,
.devices-loading,
.sessions-loading,
.plans-loading,
.loading-spinner {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--text-secondary);
}

.subscription-loading i,
.licenses-loading i,
.devices-loading i,
.sessions-loading i,
.plans-loading i,
.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 2rem 1.5rem;
}

.empty-state i {
    margin-bottom: 1rem;
}

.empty-state p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.empty-state small {
    color: var(--text-secondary);
}

.error-message {
    text-align: center;
    padding: 1.5rem;
    color: var(--error-color);
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Badge Variants */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Admin-specific Styles */
.plan-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-badge.plan-free {
    background: #e5e7eb;
    color: #374151;
}

.plan-badge.plan-basic {
    background: #dbeafe;
    color: #1e40af;
}

.plan-badge.plan-pro {
    background: #fef3c7;
    color: #92400e;
}

.plan-badge.plan-enterprise {
    background: #fce7f3;
    color: #831843;
}

.license-key-small {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.session-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 50px;
    font-size: 0.875rem;
}

/* Plans Grid for Admin */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.plan-admin-card {
    background: white;
    border: 2px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.plan-admin-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.plan-admin-card.plan-pro {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(240, 147, 251, 0.03) 100%);
    box-shadow: var(--shadow-colored);
}

.plan-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.plan-admin-header h3 {
    margin: 0;
}

.plan-admin-price {
    text-align: center;
    margin-bottom: 1.5rem;
}

.plan-admin-price .currency {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.plan-admin-price .amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.plan-admin-price .period {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.plan-admin-details {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.plan-admin-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-primary-outline {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-success-outline {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid var(--success-color);
    color: var(--success-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-success-outline:hover {
    background: var(--success-color);
    color: white;
}

/* Pricing Section Updates */
.pricing-price .period {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.pricing-price .per-credit {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 500;
}

.feature-item i.fa-star {
    color: #fbbf24;
}

/* Responsive */
@media (max-width: 768px) {
    .subscription-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .plan-price {
        text-align: left;
    }
    
    .license-details {
        grid-template-columns: 1fr;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .sessions-table {
        font-size: 0.875rem;
    }
    
    .sessions-table th,
    .sessions-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
