/**
 * Займы.ру - Main Stylesheet
 * Base styles are inline in layouts/main.php for performance
 * This file contains additional/override styles
 */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(102, 126, 234, 0.2);
}

/* Focus states */
:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* Transitions */
a, button, .btn, .card {
    transition: all 0.2s ease;
}

/* Form inputs */
input, select, textarea {
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Checkbox custom */
input[type="checkbox"] {
    accent-color: var(--primary);
}

/* Details/Summary animation */
details {
    transition: all 0.2s;
}

details[open] {
    padding-bottom: 10px;
}

/* Card hover effect */
.card:hover {
    box-shadow: var(--shadow-lg);
}

/* MFO card specific */
.mfo-card:hover .mfo-name {
    color: var(--primary);
}

/* Button loading state */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--dark);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Rating stars */
.rating-stars {
    display: inline-flex;
    gap: 2px;
}

.rating-stars .star {
    color: var(--gray-300);
}

.rating-stars .star.filled {
    color: var(--warning);
}

/* Badge pulse */
.badge-pulse {
    position: relative;
}

.badge-pulse::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: inherit;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .btn,
    .sidebar {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
