/**
 * Magic Login - Admin Styles
 *
 * Clean, professional admin interface
 */

/* ==========================================================================
   Variables
   ========================================================================== */

.ml-admin-wrap {
    --ml-admin-primary: #2563eb;
    --ml-admin-primary-hover: #1d4ed8;
    --ml-admin-success: #16a34a;
    --ml-admin-warning: #ca8a04;
    --ml-admin-error: #dc2626;
    --ml-admin-info: #0284c7;

    --ml-admin-bg: #f1f5f9;
    --ml-admin-white: #ffffff;
    --ml-admin-dark: #0f172a;
    --ml-admin-text: #1e293b;
    --ml-admin-text-muted: #64748b;
    --ml-admin-border: #e2e8f0;
    --ml-admin-border-light: #f1f5f9;

    --ml-admin-radius: 8px;
    --ml-admin-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.ml-admin-wrap {
    max-width: 900px;
    margin: 20px 20px 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   Header
   ========================================================================== */

.ml-admin-header {
    background: linear-gradient(135deg, var(--ml-admin-primary) 0%, #1e40af 100%);
    color: white;
    padding: 24px 32px;
    border-radius: var(--ml-admin-radius) var(--ml-admin-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ml-admin-header h1 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.ml-admin-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.ml-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.ml-status-active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.ml-status-inactive {
    background: rgba(0, 0, 0, 0.2);
    color: white;
}

.ml-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.ml-admin-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid var(--ml-admin-border);
    padding: 0 16px;
    gap: 4px;
}

.ml-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ml-admin-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.ml-tab:hover {
    color: var(--ml-admin-text);
}

.ml-tab-active {
    color: var(--ml-admin-primary);
    border-bottom-color: var(--ml-admin-primary);
}

.ml-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.ml-card {
    background: var(--ml-admin-white);
    border: 1px solid var(--ml-admin-border);
    border-radius: var(--ml-admin-radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.ml-card-header {
    background: var(--ml-admin-border-light);
    padding: 16px 24px;
    border-bottom: 1px solid var(--ml-admin-border);
}

.ml-card-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ml-admin-dark);
}

.ml-card-body {
    padding: 24px;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.ml-field {
    margin-bottom: 24px;
}

.ml-field:last-child {
    margin-bottom: 0;
}

.ml-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ml-admin-dark);
    margin-bottom: 8px;
}

.ml-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--ml-admin-text);
    background: white;
    border: 1px solid var(--ml-admin-border);
    border-radius: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ml-input:focus {
    outline: none;
    border-color: var(--ml-admin-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ml-input-small {
    width: 100px;
    max-width: 100px;
}

.ml-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ml-input-suffix {
    color: var(--ml-admin-text-muted);
    font-size: 14px;
}

.ml-textarea {
    width: 100%;
    max-width: 600px;
    min-height: 150px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    line-height: 1.6;
    color: var(--ml-admin-text);
    background: white;
    border: 1px solid var(--ml-admin-border);
    border-radius: 6px;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ml-textarea:focus {
    outline: none;
    border-color: var(--ml-admin-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ml-field-description {
    margin-top: 8px;
    font-size: 13px;
    color: var(--ml-admin-text-muted);
    line-height: 1.5;
}

/* Toggle */
.ml-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.ml-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ml-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--ml-admin-border);
    border-radius: 24px;
    transition: background 0.2s;
}

.ml-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ml-toggle input:checked + .ml-toggle-slider {
    background: var(--ml-admin-success);
}

.ml-toggle input:checked + .ml-toggle-slider::before {
    transform: translateX(20px);
}

.ml-toggle input:focus + .ml-toggle-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.ml-toggle-label {
    font-size: 14px;
    color: var(--ml-admin-text);
}

/* Radio */
.ml-radio-group {
    display: flex;
    gap: 24px;
}

.ml-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.ml-radio input {
    width: 18px;
    height: 18px;
    margin: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.ml-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
}

.ml-button-primary {
    background: var(--ml-admin-primary);
    color: white;
}

.ml-button-primary:hover {
    background: var(--ml-admin-primary-hover);
}

.ml-button-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.ml-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.ml-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ml-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--ml-admin-border-light);
    color: var(--ml-admin-dark);
    font-weight: 600;
    border-bottom: 1px solid var(--ml-admin-border);
}

.ml-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ml-admin-border);
    color: var(--ml-admin-text);
}

.ml-table tr:last-child td {
    border-bottom: none;
}

.ml-table code {
    background: var(--ml-admin-border-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* ==========================================================================
   Code Blocks
   ========================================================================== */

.ml-code-block {
    background: var(--ml-admin-dark);
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.ml-code-block code {
    color: #a5f3fc;
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    background: none;
    padding: 0;
}

/* ==========================================================================
   Notices
   ========================================================================== */

.ml-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--ml-admin-radius);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.ml-notice-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.ml-notice-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
}

.ml-notice-warning {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}

.ml-notice .dashicons {
    flex-shrink: 0;
    margin-top: 2px;
}

.ml-notice ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.ml-notice li {
    margin-bottom: 4px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.ml-admin-footer {
    text-align: center;
    padding: 20px;
    color: var(--ml-admin-text-muted);
    font-size: 13px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 782px) {
    .ml-admin-wrap {
        margin: 10px;
    }

    .ml-admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .ml-admin-tabs {
        overflow-x: auto;
        padding: 0 8px;
    }

    .ml-tab {
        padding: 12px 16px;
        white-space: nowrap;
    }

    .ml-card-body {
        padding: 16px;
    }

    .ml-input,
    .ml-textarea {
        max-width: 100%;
    }

    .ml-radio-group {
        flex-direction: column;
        gap: 12px;
    }
}
