/* ===============================================
   REUSABLE COMPONENT CLASSES
   Reduces duplication in main.css
   =============================================== */

/* Card Base */
.card-base {
    background: var(--background-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-large);
    border-color: var(--primary-color);
}

.card-hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 112, 243, 0.2);
}

/* Flex Layouts */
.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;
}

.flex-wrap {
    display: flex;
    flex-wrap: wrap;
}

/* Grid Layouts */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-4-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* Button Base */
.btn-base {
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 112, 243, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Icon Containers */
.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 112, 243, 0.1);
    color: var(--primary-color);
    font-size: 1.5rem;
}

.icon-circle-lg {
    width: 70px;
    height: 70px;
    font-size: 2rem;
}

.icon-square {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 112, 243, 0.1);
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge-primary {
    background: rgba(0, 112, 243, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(0, 112, 243, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Section Backgrounds */
.section-primary-bg {
    background: var(--background-primary);
}

.section-secondary-bg {
    background: var(--background-secondary);
}

.section-gradient-bg {
    background: linear-gradient(135deg, #0a0f1a 0%, #1a2332 100%);
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    transition: opacity var(--transition-normal);
}

.overlay-gradient {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

/* Divider */
.divider {
    height: 3px;
    width: 60px;
    background: linear-gradient(90deg, var(--primary-color), rgba(0, 112, 243, 0.3));
    margin: 1rem auto;
    border-radius: 2px;
}

.divider-left {
    margin-left: 0;
    margin-right: auto;
}

.divider-full {
    width: 100%;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .grid-2-cols,
    .grid-3-cols,
    .grid-4-cols {
        grid-template-columns: 1fr;
    }

    .icon-circle-lg {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }

    .btn-base {
        padding: 0.75rem 1.75rem;
        font-size: 0.9rem;
    }
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Focus States for Accessibility */
.focusable:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.focusable:focus:not(:focus-visible) {
    outline: none;
}

/* Truncate Text */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
