/**
 * RAD Cherry Dashboard Frontend Styles
 * Main styles are in the header.php template
 * This file is for additional/supplemental styles
 */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile menu toggle */
.slf-mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .slf-mobile-toggle {
        display: flex;
    }
}

/* Loading overlay */
.slf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 11, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.slf-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.slf-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--color-surface-2) 25%, var(--color-surface-3) 50%, var(--color-surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

/* Transition animations */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Client card hover effects */
.card:hover {
    border-color: var(--color-border-light);
}

/* Action button groups */
.btn-group {
    display: flex;
    gap: 8px;
}

.btn-group .btn {
    flex: 1;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.online {
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.offline {
    background: var(--color-text-dim);
}

.status-dot.warning {
    background: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
}

/* Progress bars */
.progress-bar {
    height: 8px;
    background: var(--color-surface-3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background: var(--color-surface-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Tab underline animation */
.tab-link {
    position: relative;
}

.tab-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.tab-link.active::after,
.tab-link:hover::after {
    transform: scaleX(1);
}

/* Code blocks */
code {
    font-family: var(--font-mono);
    background: var(--color-surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

pre {
    background: var(--color-surface-2);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal, .modal-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Dropdown menus */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    min-width: 180px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 50;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--color-text-muted);
    font-size: 14px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 8px 0;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.toast.success {
    border-color: var(--color-success);
}

.toast.error {
    border-color: var(--color-danger);
    max-width: 600px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Print styles */
@media print {
    .slf-sidebar,
    .slf-header-actions,
    .btn {
        display: none !important;
    }
    
    .slf-main {
        margin-left: 0 !important;
    }
}

/* Contextual Help Tips */
.ctx-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(229, 77, 77, 0.04);
    border: 1px solid rgba(229, 77, 77, 0.15);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-muted);
    position: relative;
}
.ctx-tip .ctx-icon {
    flex-shrink: 0;
    font-size: 16px;
    margin-top: 1px;
}
.ctx-tip .ctx-body {
    flex: 1;
}
.ctx-tip .ctx-body strong {
    color: var(--color-text);
    font-weight: 600;
}
.ctx-tip .ctx-body a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}
.ctx-tip .ctx-body a:hover {
    text-decoration: underline;
}
.ctx-tip .ctx-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-dim);
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.ctx-tip .ctx-dismiss:hover {
    opacity: 1;
}
