/**
 * AZIRA - Authentication Animations and UI Enhancements
 * Provides animations and styling for the authentication system
 */

/* User Name Animation in Header */
.animate-user-name {
    animation: fadeInScale 0.5s ease-in-out;
    color: var(--primary-color);
    font-weight: bold;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    text-align: center;
    min-width: 200px;
}

.cart-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* User Greeting in Header */
.user-greeting {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #555;
    transition: all 0.3s ease;
}

.user-greeting:hover .user-name {
    color: var(--primary-color);
}

.user-greeting:before {
    content: "\f007";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: 8px;
    color: var(--primary-color);
    font-size: 18px;
}

/* Logout Button Animation */
.logout-button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.logout-button:after {
    content: "";
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.logout-button:hover:after {
    right: 0;
}

/* Form Validation Styles */
.form-control.is-valid {
    border-color: #28a745;
    padding-left: 40px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 1.5rem;
    animation: validInputPulse 0.5s ease-in-out;
}

@keyframes validInputPulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* Login Success Animation */
.login-success {
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

.login-success:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(40, 167, 69, 0.8), rgba(40, 167, 69, 0.6));
    z-index: 1;
    opacity: 0;
    animation: successOverlay 1s ease forwards;
}

@keyframes successOverlay {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Success Checkmark Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    padding: 0;
}

.check-icon::before {
    content: '';
    position: absolute;
    top: 3px;
    left: -2px;
    width: 30px;
    height: 15px;
    border-style: solid;
    border-width: 0 0 8px 8px;
    border-color: #fff;
    transform-origin: 100% 100%;
    transform: rotate(-45deg);
    opacity: 0;
    animation: checkmarkPath 0.4s ease 0.7s forwards;
}

@keyframes checkmarkPath {
    0% {
        height: 0;
        width: 0;
        opacity: 0;
    }
    33% {
        height: 8px;
        width: 16px;
        opacity: 1;
    }
    100% {
        height: 15px;
        width: 30px;
        opacity: 1;
    }
}

/* Form Shake Animation */
.shake-animation {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Password Toggle Animation */
.pulse-animation {
    animation: pulse 0.3s ease-in-out;
}

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

.form-control.is-invalid {
    border-color: #dc3545;
    padding-left: 40px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 1.5rem;
}

/* Alert Animation */
.animate-message {
    animation: slideDown 0.5s ease-in-out;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cart Count Badge Animation */
.cart-count {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Profile Image Animation */
.profile-image {
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.profile-image:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Booking Status Badges */
.booking-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.booking-status.pending {
    background-color: #ffeeba;
    color: #856404;
}

.booking-status.confirmed {
    background-color: #d4edda;
    color: #155724;
}

.booking-status.cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.booking-status.completed {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Empty Cart Animation */
.empty-cart {
    text-align: center;
    padding: 40px 0;
    animation: fadeIn 1s ease-in-out;
}

.empty-cart i {
    color: #ddd;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* User Dropdown Menu Animation */
.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.user-dropdown-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    color: #333;
    transition: all 0.2s ease;
}

.user-dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.user-dropdown-item i {
    margin-left: 10px;
    color: var(--primary-color);
}
