/* BookingPlace - Utility Classes */

/* Loading Spinner Styles */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

.loading-spinner.dark {
    border-color: rgba(0,0,0,.3);
    border-top-color: #333;
}

.loading-spinner.large {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.loading-spinner.small {
    width: 12px;
    height: 12px;
    border-width: 1px;
}

/* Button Loading State */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.btn.btn-outline-primary.loading::after,
.btn.btn-outline-secondary.loading::after,
.btn.btn-outline-success.loading::after,
.btn.btn-outline-danger.loading::after,
.btn.btn-outline-warning.loading::after,
.btn.btn-outline-info.loading::after,
.btn.btn-outline-light.loading::after,
.btn.btn-outline-dark.loading::after {
    border-color: rgba(0,0,0,.3);
    border-top-color: currentColor;
}

/* Page Loading Overlay */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.page-loading.hide {
    opacity: 0;
    pointer-events: none;
}

.page-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: var(--primary-color, #667eea);
    animation: spin 1s ease-in-out infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

.skeleton-text {
    height: 1em;
    margin: 0.5em 0;
    border-radius: 4px;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin: 0.5em 0;
    border-radius: 4px;
}

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

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

.skeleton-button {
    height: 36px;
    width: 100px;
    border-radius: 4px;
}

/* Fade Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

.fade-out {
    opacity: 1;
    animation: fadeOut 0.5s ease-out forwards;
}

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

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

/* Slide Animations */
.slide-up {
    animation: slideUp 0.3s ease-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

.slide-left {
    animation: slideLeft 0.3s ease-out;
}

.slide-right {
    animation: slideRight 0.3s ease-out;
}

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

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

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

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

/* Bounce Animation */
.bounce {
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Utility Classes */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.pointer {
    cursor: pointer;
}

.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.invisible {
    opacity: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Spacing Utilities */
.spacing-xs { margin: 0.25rem; }
.spacing-sm { margin: 0.5rem; }
.spacing-md { margin: 1rem; }
.spacing-lg { margin: 1.5rem; }
.spacing-xl { margin: 3rem; }

.padding-xs { padding: 0.25rem; }
.padding-sm { padding: 0.5rem; }
.padding-md { padding: 1rem; }
.padding-lg { padding: 1.5rem; }
.padding-xl { padding: 3rem; }

/* Flexbox Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-around {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-grow {
    flex-grow: 1;
}

/* Text Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-break {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Background Utilities */
.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%);
}

.bg-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bg-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
    background-size: 20px 20px;
}

/* Border Utilities */
.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2)) border-box;
}

.border-radius-lg {
    border-radius: 1rem;
}

.border-radius-xl {
    border-radius: 1.5rem;
}

/* Shadow Utilities */
.shadow-soft {
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.shadow-medium {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.shadow-strong {
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.shadow-colored {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Interactive States */
.interactive {
    transition: all 0.3s ease;
    cursor: pointer;
}

.interactive:hover {
    opacity: 0.8;
}

.interactive:active {
    transform: scale(0.98);
}

/* Responsive Utilities */
@media (max-width: 575.98px) {
    .hide-xs { display: none !important; }
    .show-xs { display: block !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .hide-sm { display: none !important; }
    .show-sm { display: block !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .hide-md { display: none !important; }
    .show-md { display: block !important; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .hide-lg { display: none !important; }
    .show-lg { display: block !important; }
}

@media (min-width: 1200px) {
    .hide-xl { display: none !important; }
    .show-xl { display: block !important; }
}

/* Print Utilities */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    .page-break-before {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .page-break-inside-avoid {
        page-break-inside: avoid;
    }
}

/* Accessibility Utilities */
.focus-visible:focus {
    outline: 2px solid var(--primary-color, #667eea);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color, #667eea);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Error States */
.error-state {
    color: var(--danger-color, #dc3545);
    border-color: var(--danger-color, #dc3545);
}

.success-state {
    color: var(--success-color, #28a745);
    border-color: var(--success-color, #28a745);
}

.warning-state {
    color: var(--warning-color, #ffc107);
    border-color: var(--warning-color, #ffc107);
}

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

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--primary-color, #667eea);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color, #764ba2);
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerate {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.contain-layout {
    contain: layout;
}

.contain-paint {
    contain: paint;
}
