/**
 * Resetify - Admin Styles
 * 
 * Premium, modern styling for the admin dashboard
 * 
 * @package Resetify
 * @since 1.0.0
 */

/* ============================================
   ROOT VARIABLES & THEME
   ============================================ */
:root {
    --rm-primary: #667eea;
    --rm-primary-dark: #5568d3;
    --rm-primary-light: #8c9eff;
    --rm-secondary: #764ba2;
    --rm-success: #10b981;
    --rm-warning: #f59e0b;
    --rm-danger: #ef4444;
    --rm-info: #3b82f6;
    --rm-dark: #1f2937;
    --rm-light: #f9fafb;
    --rm-border: #e5e7eb;
    --rm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --rm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --rm-radius: 8px;
    --rm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.resetify-dashboard {
    max-width: 1400px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.resetify-dashboard h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--rm-primary) 0%, var(--rm-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.resetify-subtitle {
    color: #6b7280;
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */
.nav-tab-wrapper {
    border-bottom: 2px solid var(--rm-border);
    margin-bottom: 2rem;
    background: white;
    padding: 0 1rem;
    border-radius: var(--rm-radius) var(--rm-radius) 0 0;
    box-shadow: var(--rm-shadow);
}

.nav-tab {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 1rem 1.5rem;
    margin: 0;
    font-weight: 600;
    color: #6b7280;
    transition: var(--rm-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    background: var(--rm-light);
    color: var(--rm-primary);
    border-bottom-color: var(--rm-primary-light);
}

.nav-tab-active {
    color: var(--rm-primary);
    border-bottom-color: var(--rm-primary);
    background: var(--rm-light);
}

.nav-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ============================================
   CARDS
   ============================================ */
.rm-card {
    background: white;
    border-radius: var(--rm-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--rm-shadow);
    border: 1px solid var(--rm-border);
    transition: var(--rm-transition);
}

.rm-card:hover {
    box-shadow: var(--rm-shadow-lg);
}

.rm-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rm-dark);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rm-card h2 .dashicons {
    color: var(--rm-primary);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.rm-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rm-dark);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rm-description {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ============================================
   STATISTICS GRID
   ============================================ */
.rm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.rm-stat-item {
    background: linear-gradient(135deg, var(--rm-primary) 0%, var(--rm-primary-dark) 100%);
    padding: 1.5rem;
    border-radius: var(--rm-radius);
    color: white;
    text-align: center;
    transition: var(--rm-transition);
}

.rm-stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--rm-shadow-lg);
}

.rm-stat-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rm-stat-value {
    display: block;
    font-size: 1.875rem;
    font-weight: 700;
}

/* ============================================
   ALERTS & NOTICES
   ============================================ */
.rm-warning,
.rm-danger,
.rm-info,
.rm-success {
    padding: 1rem 1.5rem;
    border-radius: var(--rm-radius);
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-left: 4px solid;
}

.rm-warning {
    background: #fef3c7;
    border-left-color: var(--rm-warning);
    color: #92400e;
}

.rm-danger {
    background: #fee2e2;
    border-left-color: var(--rm-danger);
    color: #991b1b;
}

.rm-info {
    background: #dbeafe;
    border-left-color: var(--rm-info);
    color: #1e40af;
}

.rm-success {
    background: #d1fae5;
    border-left-color: var(--rm-success);
    color: #065f46;
}

.rm-warning .dashicons,
.rm-danger .dashicons,
.rm-info .dashicons,
.rm-success .dashicons {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============================================
   BUTTONS
   ============================================ */
.button-large {
    font-size: 1rem !important;
    padding: 0.75rem 2rem !important;
    height: auto !important;
    border-radius: var(--rm-radius) !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: var(--rm-transition) !important;
}

.button-primary {
    background: linear-gradient(135deg, var(--rm-primary) 0%, var(--rm-primary-dark) 100%) !important;
    border: none !important;
    box-shadow: var(--rm-shadow) !important;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--rm-shadow-lg) !important;
}

.rm-button-danger {
    background: linear-gradient(135deg, var(--rm-danger) 0%, #dc2626 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: var(--rm-shadow) !important;
}

.rm-button-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--rm-shadow-lg) !important;
}

/* ============================================
   OPTIONS & CHECKBOXES
   ============================================ */
.rm-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--rm-light);
    border-radius: var(--rm-radius);
}

.rm-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--rm-transition);
}

.rm-options label:hover {
    color: var(--rm-primary);
}

.rm-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   NUCLEAR RESET STYLING
   ============================================ */
.rm-nuclear-card {
    border: 2px solid var(--rm-danger);
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.rm-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rm-badge-danger {
    background: var(--rm-danger);
    color: white;
}

.rm-nuclear-features ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.rm-nuclear-features li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--rm-dark);
}

.rm-nuclear-features li .dashicons {
    color: var(--rm-danger);
}

/* ============================================
   TOOLS GRID
   ============================================ */
.rm-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.rm-tool-card {
    text-align: center;
    border: 2px solid var(--rm-border);
    transition: var(--rm-transition);
}

.rm-tool-card:hover {
    border-color: var(--rm-primary);
    transform: translateY(-4px);
}

.rm-tool-card h3 {
    justify-content: center;
    line-height: 1.6;
    min-height: 50px;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.rm-tool-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    min-height: 60px;
    line-height: 1.6;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.rm-form-row {
    margin-bottom: 1.5rem;
}

.rm-form-row label {
    display: block;
    font-weight: 600;
    color: var(--rm-dark);
    margin-bottom: 0.5rem;
}

.rm-form-row input[type="text"],
.rm-form-row input[type="number"],
.rm-form-row textarea {
    width: 100%;
    max-width: 600px;
}

.rm-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rm-checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius);
    padding: 1rem;
    background: var(--rm-light);
}

.rm-checkbox-list label {
    display: block;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    transition: var(--rm-transition);
}

.rm-checkbox-list label:hover {
    background: white;
}

/* ============================================
   TABLES
   ============================================ */
.wp-list-table {
    border-radius: var(--rm-radius);
    overflow: hidden;
}

.wp-list-table th {
    background: linear-gradient(135deg, var(--rm-primary) 0%, var(--rm-primary-dark) 100%);
    color: white !important;
    font-weight: 600;
    padding: 1rem !important;
}

.wp-list-table td {
    padding: 1rem !important;
}

.wp-list-table .button {
    margin-right: 0.5rem;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.rm-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.rm-loading .spinner {
    float: none;
    margin: 0 auto 1rem;
}

.rm-empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.rm-empty-state .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.rm-empty-state h3 {
    color: var(--rm-dark);
    margin-bottom: 0.5rem;
}

/* ============================================
   INFO CARDS
   ============================================ */
.rm-info-card {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid var(--rm-info);
}

.rm-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rm-info-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.rm-info-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--rm-info);
    font-weight: 700;
}

/* ============================================
   FOOTER
   ============================================ */
.resetify-footer {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 782px) {
    .rm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rm-tools-grid {
        grid-template-columns: 1fr;
    }

    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rm-card {
    animation: slideIn 0.3s ease-out;
}

/* ============================================
   SWEET ALERT CUSTOMIZATION
   ============================================ */
.swal2-popup {
    border-radius: var(--rm-radius) !important;
}

.swal2-title {
    line-height: 1.4 !important;
    margin-bottom: 15px !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, var(--rm-primary) 0%, var(--rm-primary-dark) 100%) !important;
}

.swal2-cancel {
    background: #6b7280 !important;
}

/* ============================================
   TAB SWITCHING ANIMATIONS
   ============================================ */
.resetify-content {
    transition: opacity 0.2s ease-in-out;
}

.resetify-content.loading {
    opacity: 0.5;
}

/* Smooth loading spinner */
.rm-loading .spinner {
    display: block;
    margin: 0 auto;
}

/* Tab navigation hover effects */
.nav-tab {
    position: relative;
    overflow: hidden;
}

.nav-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--rm-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-tab:hover::after {
    width: 100%;
}

.nav-tab-active::after {
    width: 100%;
}

/* ============================================
   FIX: Prevent WordPress footer overlap
   ============================================ */
.resetify-tab-content {
    padding-bottom: 80px;
    clear: both;
    min-height: 500px;
}

.resetify-dashboard::after {
    content: "";
    display: table;
    clear: both;
}

/* Fix for WordPress admin footer */
#wpfooter {
    position: relative !important;
}
