/**
 * ReportedIP DNS Checker - Design System
 *
 * Core styles, CSS variables, and reusable components
 * Based on ReportedIP Design System
 *
 * @package ReportedIP_DNSChecker
 * @since 2.0.0
 */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* Primary Colors - Indigo */
    --rip-primary: #4F46E5;
    --rip-primary-50: #EEF2FF;
    --rip-primary-100: #E0E7FF;
    --rip-primary-200: #C7D2FE;
    --rip-primary-300: #A5B4FC;
    --rip-primary-400: #818CF8;
    --rip-primary-500: #6366F1;
    --rip-primary-600: #4F46E5;
    --rip-primary-700: #4338CA;
    --rip-primary-800: #3730A3;
    --rip-primary-900: #312E81;
    --rip-primary-light: #818CF8;
    --rip-primary-dark: #3730A3;

    /* Status Colors */
    --rip-success: #10B981;
    --rip-success-light: #34D399;
    --rip-success-dark: #059669;
    --rip-success-bg: rgba(16, 185, 129, 0.1);

    --rip-danger: #EF4444;
    --rip-danger-light: #F87171;
    --rip-danger-dark: #DC2626;
    --rip-danger-bg: rgba(239, 68, 68, 0.1);

    --rip-warning: #F59E0B;
    --rip-warning-light: #FBBF24;
    --rip-warning-dark: #D97706;
    --rip-warning-bg: rgba(245, 158, 11, 0.1);

    --rip-info: #3B82F6;
    --rip-info-light: #60A5FA;
    --rip-info-dark: #2563EB;
    --rip-info-bg: rgba(59, 130, 246, 0.1);

    /* Neutral Colors */
    --rip-white: #FFFFFF;
    --rip-black: #000000;
    --rip-gray-50: #F9FAFB;
    --rip-gray-100: #F3F4F6;
    --rip-gray-200: #E5E7EB;
    --rip-gray-300: #D1D5DB;
    --rip-gray-400: #9CA3AF;
    --rip-gray-500: #6B7280;
    --rip-gray-600: #4B5563;
    --rip-gray-700: #374151;
    --rip-gray-800: #1F2937;
    --rip-gray-900: #111827;

    /* Gradients */
    --rip-gradient-primary: linear-gradient(135deg, #4F46E5, #7C3AED);
    --rip-gradient-success: linear-gradient(135deg, #10B981, #14B8A6);
    --rip-gradient-danger: linear-gradient(135deg, #EF4444, #F97316);
    --rip-gradient-dark: linear-gradient(135deg, #1F2937, #111827);
    --rip-gradient-header: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #4F46E5 100%);

    /* Shadows */
    --rip-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --rip-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --rip-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --rip-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --rip-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --rip-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --rip-shadow-glow-primary: 0 0 20px rgba(79, 70, 229, 0.3);
    --rip-shadow-glow-success: 0 0 20px rgba(16, 185, 129, 0.3);
    --rip-shadow-glow-danger: 0 0 20px rgba(239, 68, 68, 0.3);

    /* Border Radius */
    --rip-radius-sm: 0.25rem;
    --rip-radius: 0.375rem;
    --rip-radius-md: 0.5rem;
    --rip-radius-lg: 0.75rem;
    --rip-radius-xl: 1rem;
    --rip-radius-2xl: 1.5rem;
    --rip-radius-full: 9999px;

    /* Spacing */
    --rip-space-1: 0.25rem;
    --rip-space-2: 0.5rem;
    --rip-space-3: 0.75rem;
    --rip-space-4: 1rem;
    --rip-space-5: 1.25rem;
    --rip-space-6: 1.5rem;
    --rip-space-8: 2rem;
    --rip-space-10: 2.5rem;
    --rip-space-12: 3rem;

    /* Typography */
    --rip-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rip-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    --rip-text-xs: 0.75rem;
    --rip-text-sm: 0.875rem;
    --rip-text-base: 1rem;
    --rip-text-lg: 1.125rem;
    --rip-text-xl: 1.25rem;
    --rip-text-2xl: 1.5rem;
    --rip-text-3xl: 1.875rem;
    --rip-text-4xl: 2.25rem;

    /* Transitions */
    --rip-transition-fast: 150ms ease;
    --rip-transition: 200ms ease;
    --rip-transition-slow: 300ms ease;

    /* Z-Index */
    --rip-z-dropdown: 1000;
    --rip-z-sticky: 1020;
    --rip-z-fixed: 1030;
    --rip-z-modal-backdrop: 1040;
    --rip-z-modal: 1050;
    --rip-z-popover: 1060;
    --rip-z-tooltip: 1070;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

.rip-wrap {
    font-family: var(--rip-font-sans);
    font-size: var(--rip-text-sm);
    line-height: 1.5;
    color: var(--rip-gray-700);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rip-wrap *,
.rip-wrap *::before,
.rip-wrap *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Header Component
   ========================================================================== */

.rip-header {
    background: var(--rip-gradient-header);
    background-size: 200% 200%;
    padding: var(--rip-space-6) var(--rip-space-6);
    margin: -1px -1px 0 -20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--rip-space-4);
}

.rip-header__brand {
    display: flex;
    align-items: center;
    gap: var(--rip-space-4);
}

.rip-header__logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--rip-radius-lg);
    padding: var(--rip-space-2);
}

.rip-header__logo svg,
.rip-header__logo img {
    width: 100%;
    height: 100%;
    color: white;
}

.rip-header__title {
    margin: 0;
    font-size: var(--rip-text-2xl);
    font-weight: 700;
    color: white;
}

.rip-header__subtitle {
    margin: 0.25rem 0 0;
    font-size: var(--rip-text-sm);
    color: rgba(255, 255, 255, 0.8);
}

.rip-header__actions {
    display: flex;
    align-items: center;
    gap: var(--rip-space-3);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.rip-card {
    background: white;
    border: 1px solid var(--rip-gray-200);
    border-radius: var(--rip-radius-lg);
    box-shadow: var(--rip-shadow-sm);
    transition: var(--rip-transition);
}

.rip-card:hover {
    box-shadow: var(--rip-shadow);
}

.rip-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--rip-space-4) var(--rip-space-5);
    border-bottom: 1px solid var(--rip-gray-100);
}

.rip-card__title {
    margin: 0;
    font-size: var(--rip-text-base);
    font-weight: 600;
    color: var(--rip-gray-900);
    display: flex;
    align-items: center;
    gap: var(--rip-space-2);
}

.rip-card__title svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--rip-primary);
}

.rip-card__body {
    padding: var(--rip-space-5);
}

.rip-card__footer {
    padding: var(--rip-space-4) var(--rip-space-5);
    border-top: 1px solid var(--rip-gray-100);
    background: var(--rip-gray-50);
    border-radius: 0 0 var(--rip-radius-lg) var(--rip-radius-lg);
}

/* ==========================================================================
   Stat Cards
   ========================================================================== */

.rip-stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--rip-space-4);
    margin-bottom: var(--rip-space-6);
}

.rip-stat-card {
    background: white;
    border: 1px solid var(--rip-gray-200);
    border-radius: var(--rip-radius-lg);
    padding: var(--rip-space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--rip-space-4);
    transition: var(--rip-transition);
    position: relative;
    overflow: hidden;
}

.rip-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rip-primary);
    opacity: 0;
    transition: var(--rip-transition);
}

.rip-stat-card:hover {
    box-shadow: var(--rip-shadow-md);
    transform: translateY(-2px);
}

.rip-stat-card:hover::before {
    opacity: 1;
}

.rip-stat-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rip-radius-lg);
    flex-shrink: 0;
}

.rip-stat-card__icon svg {
    width: 24px;
    height: 24px;
}

.rip-stat-card__icon--primary {
    background: var(--rip-primary-100);
    color: var(--rip-primary);
}

.rip-stat-card__icon--success {
    background: var(--rip-success-bg);
    color: var(--rip-success);
}

.rip-stat-card__icon--danger {
    background: var(--rip-danger-bg);
    color: var(--rip-danger);
}

.rip-stat-card__icon--warning {
    background: var(--rip-warning-bg);
    color: var(--rip-warning);
}

.rip-stat-card__icon--info {
    background: var(--rip-info-bg);
    color: var(--rip-info);
}

.rip-stat-card__content {
    flex: 1;
    min-width: 0;
}

.rip-stat-card__value {
    font-size: var(--rip-text-2xl);
    font-weight: 700;
    color: var(--rip-gray-900);
    line-height: 1.2;
}

.rip-stat-card__label {
    font-size: var(--rip-text-sm);
    color: var(--rip-gray-500);
    margin-top: var(--rip-space-1);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.rip-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--rip-space-2);
    padding: var(--rip-space-2) var(--rip-space-4);
    border: none;
    border-radius: var(--rip-radius);
    font-family: inherit;
    font-size: var(--rip-text-sm);
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: var(--rip-transition);
    text-decoration: none;
    white-space: nowrap;
}

.rip-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.rip-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rip-button svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.rip-button--primary {
    background: var(--rip-gradient-primary);
    color: white;
    box-shadow: var(--rip-shadow-sm);
}

.rip-button--primary:hover:not(:disabled) {
    box-shadow: var(--rip-shadow-md), var(--rip-shadow-glow-primary);
    transform: translateY(-1px);
}

.rip-button--secondary {
    background: white;
    color: var(--rip-gray-700);
    border: 1px solid var(--rip-gray-300);
}

.rip-button--secondary:hover:not(:disabled) {
    background: var(--rip-gray-50);
    border-color: var(--rip-gray-400);
}

.rip-button--success {
    background: var(--rip-gradient-success);
    color: white;
}

.rip-button--success:hover:not(:disabled) {
    box-shadow: var(--rip-shadow-md), var(--rip-shadow-glow-success);
    transform: translateY(-1px);
}

.rip-button--danger {
    background: var(--rip-danger);
    color: white;
}

.rip-button--danger:hover:not(:disabled) {
    background: var(--rip-danger-dark);
    box-shadow: var(--rip-shadow-md), var(--rip-shadow-glow-danger);
}

.rip-button--ghost {
    background: transparent;
    color: var(--rip-gray-600);
}

.rip-button--ghost:hover:not(:disabled) {
    background: var(--rip-gray-100);
    color: var(--rip-gray-900);
}

.rip-button--sm {
    padding: var(--rip-space-1) var(--rip-space-3);
    font-size: var(--rip-text-xs);
}

.rip-button--lg {
    padding: var(--rip-space-3) var(--rip-space-6);
    font-size: var(--rip-text-base);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.rip-input,
.rip-select,
.rip-textarea {
    width: 100%;
    padding: var(--rip-space-2) var(--rip-space-3);
    background: white;
    border: 1px solid var(--rip-gray-300);
    border-radius: var(--rip-radius);
    font-family: inherit;
    font-size: var(--rip-text-sm);
    color: var(--rip-gray-900);
    transition: var(--rip-transition);
}

.rip-input:focus,
.rip-select:focus,
.rip-textarea:focus {
    outline: none;
    border-color: var(--rip-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.rip-input::placeholder {
    color: var(--rip-gray-400);
}

.rip-label {
    display: block;
    font-size: var(--rip-text-sm);
    font-weight: 500;
    color: var(--rip-gray-700);
    margin-bottom: var(--rip-space-1);
}

.rip-help-text {
    font-size: var(--rip-text-xs);
    color: var(--rip-gray-500);
    margin-top: var(--rip-space-1);
}

.rip-form-group {
    margin-bottom: var(--rip-space-5);
}

/* ==========================================================================
   Toggle Switch
   ========================================================================== */

.rip-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--rip-space-3);
    cursor: pointer;
}

.rip-toggle__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rip-toggle__slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--rip-gray-300);
    border-radius: var(--rip-radius-full);
    transition: var(--rip-transition);
    flex-shrink: 0;
}

.rip-toggle__slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--rip-shadow-sm);
    transition: var(--rip-transition);
}

.rip-toggle__input:checked + .rip-toggle__slider {
    background: var(--rip-primary);
}

.rip-toggle__input:checked + .rip-toggle__slider::after {
    transform: translateX(20px);
}

.rip-toggle__label {
    font-size: var(--rip-text-sm);
    color: var(--rip-gray-700);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.rip-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--rip-space-1);
    padding: 2px 8px;
    border-radius: var(--rip-radius-full);
    font-size: var(--rip-text-xs);
    font-weight: 500;
}

.rip-badge--success {
    background: var(--rip-success-bg);
    color: var(--rip-success-dark);
}

.rip-badge--danger {
    background: var(--rip-danger-bg);
    color: var(--rip-danger-dark);
}

.rip-badge--warning {
    background: var(--rip-warning-bg);
    color: var(--rip-warning-dark);
}

.rip-badge--info {
    background: var(--rip-info-bg);
    color: var(--rip-info-dark);
}

.rip-badge--neutral {
    background: var(--rip-gray-100);
    color: var(--rip-gray-600);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.rip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--rip-text-sm);
}

.rip-table th,
.rip-table td {
    padding: var(--rip-space-3) var(--rip-space-4);
    text-align: left;
    border-bottom: 1px solid var(--rip-gray-200);
}

.rip-table th {
    background: var(--rip-gray-50);
    font-weight: 600;
    color: var(--rip-gray-700);
    white-space: nowrap;
}

.rip-table tbody tr:hover {
    background: var(--rip-gray-50);
}

.rip-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.rip-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--rip-space-12) var(--rip-space-6);
    text-align: center;
}

.rip-empty-state__icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--rip-space-4);
    color: var(--rip-gray-300);
}

.rip-empty-state__title {
    margin: 0 0 var(--rip-space-2);
    font-size: var(--rip-text-lg);
    font-weight: 600;
    color: var(--rip-gray-900);
}

.rip-empty-state__description {
    margin: 0 0 var(--rip-space-5);
    color: var(--rip-gray-500);
    max-width: 400px;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.rip-alert {
    display: flex;
    gap: var(--rip-space-3);
    padding: var(--rip-space-4);
    border-radius: var(--rip-radius-lg);
    margin-bottom: var(--rip-space-4);
}

.rip-alert__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.rip-alert__content {
    flex: 1;
}

.rip-alert__title {
    font-weight: 600;
    margin-bottom: var(--rip-space-1);
}

.rip-alert__message {
    font-size: var(--rip-text-sm);
}

.rip-alert--success {
    background: var(--rip-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--rip-success-dark);
}

.rip-alert--danger,
.rip-alert--error {
    background: var(--rip-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--rip-danger-dark);
}

.rip-alert--warning {
    background: var(--rip-warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--rip-warning-dark);
}

.rip-alert--info {
    background: var(--rip-info-bg);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--rip-info-dark);
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */

.rip-nav-tabs {
    display: flex;
    gap: var(--rip-space-1);
    background: white;
    border: 1px solid var(--rip-gray-200);
    border-radius: var(--rip-radius-lg);
    padding: var(--rip-space-1);
    margin-bottom: var(--rip-space-5);
}

.rip-nav-tabs__tab {
    display: flex;
    align-items: center;
    gap: var(--rip-space-2);
    padding: var(--rip-space-3) var(--rip-space-4);
    background: transparent;
    border: none;
    border-radius: var(--rip-radius);
    font-family: inherit;
    font-size: var(--rip-text-sm);
    font-weight: 500;
    color: var(--rip-gray-600);
    cursor: pointer;
    text-decoration: none;
    transition: var(--rip-transition);
}

.rip-nav-tabs__tab:hover {
    color: var(--rip-gray-900);
    background: var(--rip-gray-50);
}

.rip-nav-tabs__tab--active {
    color: var(--rip-primary);
    background: var(--rip-primary-50);
}

.rip-nav-tabs__tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.rip-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    animation: rip-spin 0.75s linear infinite;
}

.rip-spinner--lg {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

@keyframes rip-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Trust Badges
   ========================================================================== */

.rip-trust-badges {
    display: flex;
    justify-content: center;
    gap: var(--rip-space-6);
    padding: var(--rip-space-6) 0;
    margin-top: var(--rip-space-6);
    border-top: 1px solid var(--rip-gray-200);
}

.rip-trust-badge {
    display: flex;
    align-items: center;
    gap: var(--rip-space-2);
    font-size: var(--rip-text-sm);
    color: var(--rip-gray-500);
}

.rip-trust-badge svg {
    width: 20px;
    height: 20px;
    color: var(--rip-primary);
}

/* ==========================================================================
   Content Area
   ========================================================================== */

.rip-content {
    background: white;
    border: 1px solid var(--rip-gray-200);
    border-radius: var(--rip-radius-lg);
    padding: var(--rip-space-5);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.rip-text-primary { color: var(--rip-primary); }
.rip-text-success { color: var(--rip-success); }
.rip-text-danger { color: var(--rip-danger); }
.rip-text-warning { color: var(--rip-warning); }
.rip-text-muted { color: var(--rip-gray-500); }

.rip-mt-0 { margin-top: 0; }
.rip-mt-2 { margin-top: var(--rip-space-2); }
.rip-mt-4 { margin-top: var(--rip-space-4); }
.rip-mb-0 { margin-bottom: 0; }
.rip-mb-2 { margin-bottom: var(--rip-space-2); }
.rip-mb-4 { margin-bottom: var(--rip-space-4); }

.rip-flex { display: flex; }
.rip-items-center { align-items: center; }
.rip-justify-between { justify-content: space-between; }
.rip-gap-2 { gap: var(--rip-space-2); }
.rip-gap-4 { gap: var(--rip-space-4); }

.rip-hidden { display: none !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 782px) {
    .rip-header {
        padding: var(--rip-space-4);
    }

    .rip-header__title {
        font-size: var(--rip-text-xl);
    }

    .rip-stat-cards {
        grid-template-columns: 1fr;
    }

    .rip-nav-tabs {
        flex-wrap: wrap;
    }

    .rip-content {
        padding: var(--rip-space-4);
    }

    .rip-trust-badges {
        flex-direction: column;
        align-items: center;
        gap: var(--rip-space-3);
    }
}
