/**
 * Custom CSS Overrides
 *
 * @package FreelanceDirectory
 */

/* Additional custom styles */

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: ease;
    transition-duration: 0.15s;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection color */
::selection {
    background: rgba(245, 158, 11, 0.3);
    color: inherit;
}

/* Focus states */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Card animations */
.platform-card {
    animation: fadeInUp 0.3s ease forwards;
}

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

/* Stagger animation for grid items */
.platform-grid .platform-card:nth-child(1) { animation-delay: 0s; }
.platform-grid .platform-card:nth-child(2) { animation-delay: 0.05s; }
.platform-grid .platform-card:nth-child(3) { animation-delay: 0.1s; }
.platform-grid .platform-card:nth-child(4) { animation-delay: 0.15s; }
.platform-grid .platform-card:nth-child(5) { animation-delay: 0.2s; }
.platform-grid .platform-card:nth-child(6) { animation-delay: 0.25s; }

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Share buttons */
.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-buttons .btn {
    padding: 0.5rem;
}

/* RTL specific fixes */
.rtl .category-list {
    flex-direction: row-reverse;
}

.rtl .platform-external-link {
    left: auto;
    right: 12px;
}

.rtl .search-icon {
    right: auto;
    left: 1rem;
}

.rtl .search-input {
    padding-right: 1.5rem;
    padding-left: 3rem;
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .search-box,
    .category-filter,
    .theme-toggle,
    .lang-selector {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .platform-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}
