/**
 * RenderCAD Settings Page Styles
 * Additions only - base styles from design-system.css
 * Uses high-specificity selectors to override Bootstrap
 */

/* ========================================
   API TOKEN LIST
   Scoped to #api-tokens-list for specificity
   ======================================== */

#api-tokens-list .token-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

#api-tokens-list .token-info {
    flex: 1;
    min-width: 0;
}

#api-tokens-list .token-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Active indicator dot */
#api-tokens-list .token-name::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
}

#api-tokens-list .token-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

#api-tokens-list .token-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

#api-tokens-list .token-meta i {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* ========================================
   REVOKE BUTTON
   Maximum specificity to override Bootstrap
   ======================================== */

#api-tokens-list button.btn-revoke-token,
#api-tokens-list button.btn-revoke-token[data-token-id] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    outline: none;
    box-shadow: none;
}

#api-tokens-list button.btn-revoke-token:hover,
#api-tokens-list button.btn-revoke-token[data-token-id]:hover {
    background: var(--error-dim);
    border-color: var(--error);
    color: var(--error);
}

#api-tokens-list button.btn-revoke-token:active,
#api-tokens-list button.btn-revoke-token[data-token-id]:active {
    transform: scale(0.95);
}

#api-tokens-list button.btn-revoke-token:focus,
#api-tokens-list button.btn-revoke-token[data-token-id]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--error-dim);
}

/* Hide the text span, show only icon */
#api-tokens-list button.btn-revoke-token span,
#api-tokens-list button.btn-revoke-token[data-token-id] span {
    display: none;
}

/* ========================================
   EMPTY STATE
   ======================================== */

#no-tokens {
    padding: 2rem;
    text-align: center;
}

#no-tokens i {
    font-size: 2rem;
    color: var(--text-tertiary);
    opacity: 0.5;
    margin-bottom: 0.75rem;
}

#no-tokens p {
    color: var(--text-tertiary);
    margin: 0;
}

/* ========================================
   DANGER ZONE
   ======================================== */

.danger-zone {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--error-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
}

.danger-zone h5 {
    color: var(--error);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-zone p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ========================================
   SKELETON LOADING
   ======================================== */

.skeleton-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skeleton-settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-title {
    height: 24px;
    width: 40%;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 0.75rem;
}

.skeleton-text.large {
    height: 20px;
}

.skeleton-button {
    height: 40px;
    width: 150px;
    border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   CANCELLATION NOTICE
   ======================================== */

.cancellation-notice {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(234, 88, 12, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.cancellation-notice-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.cancellation-notice-header i {
    color: #f59e0b;
    font-size: 1.1rem;
}

.cancellation-notice-header span {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.95rem;
}

.cancellation-notice-body p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 0.5rem 0;
}

.cancellation-notice-body p:last-child {
    margin-bottom: 0;
}

.cancellation-notice-body strong {
    color: var(--text-primary);
}

.cancellation-notice-date-text {
    color: var(--text-tertiary);
}

.cancellation-notice-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(245, 158, 11, 0.2);
}

/* ========================================
   BILLING TABLE
   ======================================== */

.billing-history-responsive {
    overflow-x: auto;
}

.billing-history-responsive table {
    min-width: 400px;
}

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

@media (max-width: 768px) {
    #api-tokens-list .token-item-content {
        gap: 0.75rem;
    }

    #api-tokens-list .token-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .danger-zone {
        padding: 1rem;
    }
}
