/**
 * Memory Limit Manager - Admin Styles
 */

/* Main Container */
.memory-limit-manager-wrap {
    margin: 20px 20px 20px 0;
}

.memory-limit-manager-wrap h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #1d2327;
}

.memory-limit-manager-wrap h1 .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #2271b1;
}

.memory-limit-manager-container {
    display: grid;
    gap: 24px;
    max-width: 1400px;
}

/* Card Styles */
.mlm-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    margin-bottom: 24px;
}

.mlm-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.mlm-card-header {
    padding: 24px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mlm-card-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.mlm-card-body {
    padding: 28px;
}

/* Status Card */
.mlm-status-card .mlm-card-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.mlm-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.mlm-status-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border: 1px solid #e8eaed;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mlm-status-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mlm-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    flex-shrink: 0;
}

.mlm-status-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #fff;
}

.mlm-icon-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mlm-icon-purple {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.mlm-icon-green {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.mlm-status-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mlm-status-label {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mlm-status-value {
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
}

/* Info Box */
.mlm-info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #2196f3;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    color: #1d2327;
}

.mlm-info-box .dashicons {
    color: #2196f3;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Settings Form */
.mlm-settings-card .mlm-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mlm-form-group {
    margin-bottom: 28px;
}

.mlm-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 8px;
}

.mlm-required {
    color: #d63638;
    margin-left: 2px;
}

.mlm-input-wrapper {
    position: relative;
}

.mlm-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #1d2327;
    background-color: #fff;
    border: 2px solid #dcdcdc;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.mlm-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.mlm-input-hint {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #5f6368;
    font-style: italic;
}

/* Quick Presets */
.mlm-quick-presets {
    margin-bottom: 28px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e8eaed;
    border-radius: 10px;
}

.mlm-quick-presets .mlm-label {
    margin-bottom: 12px;
}

.mlm-preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.mlm-preset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #2271b1;
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mlm-preset-btn:hover {
    color: #fff;
    background: #2271b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.mlm-preset-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Warning Box */
.mlm-warning-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffe9a6 100%);
    border-left: 4px solid #ff9800;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    color: #1d2327;
    margin-bottom: 28px;
}

.mlm-warning-box .dashicons {
    color: #ff9800;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Form Actions */
.mlm-form-actions {
    display: flex;
    gap: 12px;
}

.mlm-submit-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.mlm-submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
}

.mlm-submit-btn:active {
    transform: translateY(0) !important;
}

.mlm-submit-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-top: -2px;
    vertical-align: middle;
}

/* Diagnostics Card */
.mlm-diagnostics-card .mlm-card-header {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.mlm-diag-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8eaed;
}

.mlm-diagnostics-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.mlm-comparison-table {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 8px;
}

.mlm-comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mlm-comparison-table thead th {
    color: #fff;
    font-weight: 600;
    padding: 12px 10px;
    text-align: left;
    border-bottom: none;
}

.mlm-comparison-table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.mlm-comparison-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.mlm-comparison-table tbody tr {
    background: #fff;
}

.mlm-comparison-table tbody tr:hover {
    background: #f8f9fa;
}

.mlm-comparison-table tbody td {
    padding: 12px 10px;
}

.mlm-diagnostics-table tbody tr {
    border-bottom: 1px solid #e8eaed;
}

.mlm-diagnostics-table tbody tr:last-child {
    border-bottom: none;
}

.mlm-diagnostics-table td {
    padding: 12px 8px;
    vertical-align: top;
}

.mlm-diag-label {
    font-weight: 600;
    color: #1d2327;
    width: 200px;
}

.mlm-diag-value {
    color: #5f6368;
}

.mlm-diag-value code {
    background: #f5f7fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #1d2327;
}

.mlm-diag-success {
    color: #00a32a;
    font-weight: 600;
}

.mlm-diag-error {
    color: #d63638;
    font-weight: 600;
}

.mlm-diag-warning {
    color: #ff9800;
    font-weight: 600;
    font-size: 12px;
    margin-left: 8px;
}

.mlm-diag-help {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f0f1;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
}

.mlm-error-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 4px solid #d63638;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    color: #1d2327;
    margin-top: 16px;
}

.mlm-error-box .dashicons {
    color: #d63638;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.mlm-error-box p {
    margin: 0 0 8px 0;
}

.mlm-error-box p:last-child {
    margin-bottom: 0;
}

.mlm-error-box pre {
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    margin: 8px 0 0 0;
    overflow-x: auto;
}

.mlm-error-box code {
    color: #d63638;
    font-weight: 600;
}

.mlm-error-box ul,
.mlm-error-box ol {
    margin: 8px 0;
    padding-left: 24px;
}

.mlm-error-box li {
    margin: 4px 0;
    line-height: 1.6;
}

/* Manual code blocks */
.mlm-warning-box pre,
.mlm-error-box pre,
.mlm-info-box pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.6;
    margin: 12px 0;
}

.mlm-warning-box pre code,
.mlm-error-box pre code,
.mlm-info-box pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.mlm-warning-box ol,
.mlm-error-box ol {
    margin: 8px 0;
    padding-left: 24px;
}

.mlm-warning-box ol li,
.mlm-error-box ol li {
    margin: 6px 0;
    line-height: 1.6;
}

/* Help Card */
.mlm-help-card .mlm-card-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.mlm-help-item {
    margin-bottom: 24px;
}

.mlm-help-item:last-child {
    margin-bottom: 0;
}

.mlm-help-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px 0;
}

.mlm-help-item p {
    font-size: 14px;
    line-height: 1.6;
    color: #5f6368;
    margin: 0;
}

.mlm-help-item ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.mlm-help-item ul li {
    font-size: 14px;
    line-height: 1.8;
    color: #5f6368;
}

/* Notices */
.notice.notice-success,
.notice.notice-error {
    border-left-width: 4px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 15px;
    margin-bottom: 24px;
}

.mlm-notice-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left-color: #28a745 !important;
}

.mlm-notice-success strong {
    color: #155724;
}

.mlm-notice-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: #dc3545 !important;
}

.mlm-notice-error strong {
    color: #721c24;
}

.mlm-notice-error ul {
    margin: 8px 0 8px 20px;
    list-style: disc;
    color: #721c24;
}

.mlm-notice-error li {
    margin: 4px 0;
    line-height: 1.6;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .memory-limit-manager-wrap {
        margin: 20px 10px 20px 0;
    }
    
    .mlm-card-body {
        padding: 20px;
    }
    
    .mlm-status-grid {
        grid-template-columns: 1fr;
    }
    
    .mlm-preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .mlm-input {
        max-width: 100%;
    }
    
    .mlm-submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading State */
.mlm-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.mlm-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: mlm-spin 1s linear infinite;
}

@keyframes mlm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation for status items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mlm-status-item {
    animation: fadeInUp 0.5s ease forwards;
}

.mlm-status-item:nth-child(1) {
    animation-delay: 0.1s;
}

.mlm-status-item:nth-child(2) {
    animation-delay: 0.2s;
}

.mlm-status-item:nth-child(3) {
    animation-delay: 0.3s;
}

