/**
 * Utility Classes
 * Replaces inline styles with reusable utility classes
 */

/* Image utilities */
.image-cover-sm {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-cover-md {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.image-cover-lg {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* Scrollable containers */
.scrollable-sm {
    max-height: 300px;
    overflow-y: auto;
}

.scrollable-md {
    max-height: 500px;
    overflow-y: auto;
}

.scrollable-lg {
    max-height: 700px;
    overflow-y: auto;
}

/* Messages container (for messaging app) */
.messages-container {
    height: 500px;
    overflow-y: auto;
    padding: var(--spacing-4);
}

@media (max-width: 768px) {
    .messages-container {
        height: 400px;
    }
}

/* Max width utilities */
.max-width-70 {
    max-width: 70%;
}

.max-width-80 {
    max-width: 80%;
}

.max-width-90 {
    max-width: 90%;
}

/* Display utilities for responsive design */
@media (max-width: 767px) {
    .d-mobile-none {
        display: none;
    }

    .d-mobile-block {
        display: block;
    }

    .d-mobile-flex {
        display: flex;
    }
}

@media (min-width: 768px) {
    .d-desktop-none {
        display: none;
    }

    .d-desktop-block {
        display: block;
    }

    .d-desktop-flex {
        display: flex;
    }
}

/* Position utilities */
.position-sticky-top {
    position: sticky;
    top: 0;
    z-index: var(--z-index-content);
}

/* Flex utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.flex-column-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 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;
}

/* Card utilities */
.card-hover {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Loading spinner */
.spinner-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Alert utilities */
.alert-fixed-top {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-index-toast);
    min-width: 300px;
    max-width: 600px;
}

@media (max-width: 768px) {
    .alert-fixed-top {
        width: 90%;
        min-width: auto;
    }
}
