/* Xpatly Custom Styles */
/* Used alongside TailwindCSS CDN */

/* ===== Base Styles ===== */
body {
    font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lexend', sans-serif;
}

/* ===== Components ===== */

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: #f9a825;
    color: white;
}

.btn-primary:hover {
    background: #f57f17;
}

.btn-secondary {
    background: #1976d2;
    color: white;
}

.btn-secondary:hover {
    background: #1565c0;
}

/* Forms */
.input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
    outline: none;
    border-color: #f9a825;
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.2);
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

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

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

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

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Badge */
.badge-expat {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: #dcfce7;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

/* ===== Flag Icons ===== */
.flag-icon {
    width: 1.5rem;
    height: 1rem;
    border-radius: 2px;
    display: inline-block;
    background-size: cover;
    background-position: center;
}

.flag-icon-gb {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='a'%3E%3Cpath d='M0 0v30h60V0z'/%3E%3C/clipPath%3E%3CclipPath id='b'%3E%3Cpath d='M30 15h30v15zv15H0zH0V0zV0h30z'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23a)'%3E%3Cpath d='M0 0v30h60V0z' fill='%23012169'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' clip-path='url(%23b)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/g%3E%3C/svg%3E");
}

.flag-icon-ee {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 33 21'%3E%3Crect width='33' height='7' fill='%230072CE'/%3E%3Crect y='7' width='33' height='7' fill='%23000'/%3E%3Crect y='14' width='33' height='7' fill='%23fff'/%3E%3C/svg%3E");
}

.flag-icon-ru {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Crect fill='%23fff' width='9' height='3'/%3E%3Crect fill='%230039A6' y='2' width='9' height='2'/%3E%3Crect fill='%23D52B1E' y='4' width='9' height='2'/%3E%3C/svg%3E");
}

/* ===== Neon Search Effect ===== */
@keyframes neon-pulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(0,0,0,0.25),
                    0 0 30px rgba(249, 168, 37, 0.5),
                    0 0 15px rgba(249, 168, 37, 0.3);
    }
    50% {
        box-shadow: 0 10px 40px rgba(0,0,0,0.25),
                    0 0 40px rgba(249, 168, 37, 0.7),
                    0 0 25px rgba(249, 168, 37, 0.5);
    }
}

.neon-search-wrapper {
    animation: neon-pulse 2s ease-in-out infinite;
}

.neon-search-wrapper:focus-within {
    animation: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25),
                0 0 50px rgba(249, 168, 37, 0.8),
                0 0 30px rgba(249, 168, 37, 0.6) !important;
}

.neon-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(249, 168, 37, 0.8),
                0 5px 20px rgba(0, 0, 0, 0.3) !important;
}

/* ===== Range Slider ===== */
.range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f9a825;
    cursor: pointer;
    transition: background 0.2s;
}

.range-slider::-webkit-slider-thumb:hover {
    background: #f57f17;
}

/* ===== Map Layering ===== */
.leaflet-container {
    z-index: 0 !important;
}

.leaflet-pane,
.leaflet-control,
.leaflet-top,
.leaflet-bottom,
.leaflet-popup-pane {
    z-index: 1 !important;
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f9a825;
    cursor: pointer;
    border: none;
}

/* ===== Alpine.js Cloak ===== */
[x-cloak] {
    display: none !important;
}

/* ===== Toast Animations ===== */
@keyframes slideInDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
}

.toast-enter {
    animation: slideInDown 0.3s ease-out;
}

.toast-leave {
    animation: slideOutUp 0.3s ease-in;
}

/* ===== Responsive Utilities ===== */
@media (max-width: 640px) {
    .flag-icon {
        width: 1.25rem;
        height: 0.875rem;
    }
}
