/* ============================================
   🚀 PREMIUM SMOOTH EFFECTS - Webrix Estate
   Software-like Premium Feel
   ============================================ */

/* ========== 1. GLOBAL SMOOTH TRANSITIONS ========== */
*, *::before, *::after {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Disable transitions for inputs while typing */
input:focus, textarea:focus, select:focus {
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* ========== 2. KEYFRAME ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

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

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

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(21, 191, 180, 0.5); }
    50% { box-shadow: 0 0 20px rgba(21, 191, 180, 0.8); }
}

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

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

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(15deg); }
    40%, 80% { transform: rotate(-15deg); }
}

/* ========== 3. PREMIUM PAGE LOADER ========== */
.premium-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.premium-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.premium-loader-logo {
    width: 110px;
    height: 110px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: none;
}

.premium-loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #15BFB4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.premium-loader-text {
    margin-top: 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.premium-loader-progress {
    width: 200px;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.premium-loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #15BFB4, #0FA79D);
    border-radius: 3px;
    animation: shimmer 1.5s ease-in-out infinite;
    background-size: 200% 100%;
}

/* ========== 4. PAGE CONTENT ANIMATIONS ========== */
.page-content {
    animation: fadeInUp 0.5s ease forwards;
}

.app {
    animation: fadeIn 0.4s ease;
}

/* ========== 5. CARD EFFECTS ========== */
.stat-card, .card, .project-card, .property-card {
    animation: fadeInUp 0.5s ease backwards;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover, .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.project-card:hover, .property-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

/* Staggered card animations */
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }

/* ========== 6. BUTTON EFFECTS ========== */
.btn, button, .action-btn, .submit-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover, button:hover, .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn:active, button:active, .action-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* ========== 7. MENU & SIDEBAR EFFECTS ========== */
.menu-item, .sidebar-menu-item {
    position: relative;
    transition: all 0.3s ease;
}

.menu-item::before, .sidebar-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #15BFB4;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.menu-item:hover::before, .sidebar-menu-item:hover::before,
.menu-item.active::before, .sidebar-menu-item.active::before {
    transform: scaleY(1);
}

.menu-item:hover, .sidebar-menu-item:hover {
    background: rgba(21, 191, 180, 0.1);
    padding-left: 20px;
}

/* ========== 8. TABLE EFFECTS ========== */
table tbody tr {
    transition: all 0.3s ease;
}

table tbody tr:hover {
    background: linear-gradient(90deg, rgba(21, 191, 180, 0.08), transparent) !important;
    transform: scale(1.01);
}

table tbody tr td {
    animation: fadeIn 0.3s ease;
}

/* ========== 9. INPUT & FORM EFFECTS ========== */
input, textarea, select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(21, 191, 180, 0.2);
}

/* Input shake on error */
.input-error {
    animation: shake 0.5s ease;
    border-color: #ff4444 !important;
}

/* ========== 10. MODAL EFFECTS ========== */
.modal, .popup, .auth-modal {
    animation: fadeIn 0.3s ease;
}

.modal-content, .popup-content, .auth-modal-content {
    animation: scaleIn 0.3s ease;
}

/* ========== 11. TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease;
    transform-origin: right center;
}

.toast.toast-success {
    border-left: 4px solid #22c55e;
}

.toast.toast-error {
    border-left: 4px solid #ef4444;
}

.toast.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-success .toast-icon { background: #dcfce7; color: #22c55e; }
.toast-error .toast-icon { background: #fee2e2; color: #ef4444; }
.toast-warning .toast-icon { background: #fef3c7; color: #f59e0b; }
.toast-info .toast-icon { background: #dbeafe; color: #3b82f6; }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #374151;
}

.toast.removing {
    animation: slideInRight 0.3s ease reverse forwards;
}

/* ========== 12. SKELETON LOADING ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: 12px;
}

.skeleton-btn {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

/* ========== 13. NOTIFICATION BELL ANIMATION ========== */
.notification-bell.has-new {
    animation: bellShake 0.5s ease;
}

/* ========== 14. COUNTER ANIMATION ========== */
.counter-animate {
    animation: countUp 0.5s ease forwards;
}

/* ========== 15. SCROLL PROGRESS BAR ========== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #15BFB4, #0FA79D);
    z-index: 99999;
    transition: width 0.1s ease;
}

/* ========== 16. BACK TO TOP BUTTON ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #15BFB4, #0FA79D); color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(21, 191, 180, 0.3);
    z-index: 9999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(21, 191, 180, 0.4);
}

/* ========== 17. CUSTOM SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #15BFB4, #0FA79D);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0FA79D, #0B857D);
}

/* ========== 18. HOVER GLOW EFFECT ========== */
.glow-on-hover:hover {
    box-shadow: 0 0 20px rgba(21, 191, 180, 0.4);
}

/* ========== 19. IMAGE HOVER EFFECTS ========== */
.image-hover-zoom {
    overflow: hidden;
}

.image-hover-zoom img {
    transition: transform 0.5s ease;
}

.image-hover-zoom:hover img {
    transform: scale(1.1);
}

/* ========== 20. DROPDOWN ANIMATIONS ========== */
.dropdown-menu {
    animation: fadeInDown 0.2s ease;
    transform-origin: top center;
}

/* ========== 21. TAG/BADGE ANIMATIONS ========== */
.badge, .tag, .status-badge {
    transition: all 0.2s ease;
}

.badge:hover, .tag:hover {
    transform: scale(1.05);
}

/* ========== 22. LINK UNDERLINE EFFECT ========== */
.link-hover-effect {
    position: relative;
}

.link-hover-effect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #15BFB4;
    transition: width 0.3s ease;
}

.link-hover-effect:hover::after {
    width: 100%;
}

/* ========== 23. FLOATING ANIMATION ========== */
.floating {
    animation: bounce 2s ease-in-out infinite;
}

/* ========== 24. SUCCESS TICK ANIMATION ========== */
@keyframes tickDraw {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

.success-tick {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: tickDraw 0.5s ease forwards;
}

/* ========== 25. PAGE TRANSITIONS ========== */
.page-transition-enter {
    opacity: 0;
    transform: translateX(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
    }
    
    .toast {
        min-width: auto;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ========== WHITE TEXT/ICONS ON RED BACKGROUNDS ========== */
.btn-primary svg,
.btn-primary path,
button[style*="15BFB4"] svg,
button[style*="15BFB4"] path,
[style*="background: #15BFB4"] svg,
[style*="background: #15BFB4"] path,
[style*="background:#15BFB4"] svg,
[style*="background:#15BFB4"] path {
    fill: #ffffff !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
}

.btn-primary,
button[style*="15BFB4"],
[style*="background: #15BFB4"],
[style*="background:#15BFB4"] {
    color: #ffffff !important;
}

.btn-primary:hover,
button[style*="15BFB4"]:hover {
    color: #ffffff !important;
}
