/* ============================================
   ADDITIONAL ANIMATIONS & EFFECTS
   ============================================ */

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(16, 185, 129, 0.3);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Hover Scale */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Hover Lift */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Hover Glow */
.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.badge:hover {
    background: var(--color-primary);
    color: white;
}

.badge.badge-success {
    background: #d1fae5;
    color: #059669;
}

.badge.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge.badge-info {
    background: #dbeafe;
    color: #0284c7;
}

/* Alert Styles */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.alert-success {
    background: #d1fae5;
    border-left-color: #10b981;
    color: #047857;
}

.alert-danger {
    background: #fee2e2;
    border-left-color: #ef4444;
    color: #dc2626;
}

.alert-warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-left-color: #0284c7;
    color: #0c4a6e;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* Progress Bar Styles */
.progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    height: 100%;
    transition: width 0.6s ease;
}

.progress-bar.progress-bar-success {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.progress-bar.progress-bar-danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.progress-bar.progress-bar-warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-bar.progress-bar-info {
    background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
}

/* Table Styles */
.table {
    border-collapse: collapse;
    width: 100%;
}

.table thead {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
}

.table thead th {
    padding: 12px 16px;
    font-weight: 600;
    text-align: left;
    border: none;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background: var(--color-dark);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -50px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    white-space: nowrap;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Divider Styles */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 24px 0;
}

.divider-text {
    text-align: center;
    position: relative;
    margin: 24px 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e5e7eb;
}

.divider-text::before {
    left: 0;
}

.divider-text::after {
    right: 0;
}

.divider-text span {
    background: white;
    padding: 0 10px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}

/* Loading States */
.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.loader-content .spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
}

.loader-content p {
    margin: 16px 0 0 0;
    color: #6b7280;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #374151;
    margin-bottom: 10px;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 20px;
}

/* Success Checkmark */
.checkmark {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #d1fae5;
    position: relative;
    margin-bottom: 20px;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: block;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: #10b981;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes stroke {
    90% {
        stroke-dashoffset: 48;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Text Truncate */
.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;
}

/* Responsive Grid */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 768px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Responsive Media */
img {
    max-width: 100%;
    height: auto;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Neumorphic Style */
.neumorphic {
    background: linear-gradient(145deg, #e5e7eb, #e5e7eb);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1),
                inset -2px -2px 5px rgba(255, 255, 255, 0.5),
                2px 2px 5px rgba(0, 0, 0, 0.1),
                -2px -2px 5px rgba(255, 255, 255, 0.5);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-dark: #f9fafb;
        --color-gray: #e5e7eb;
        --color-light-gray: #374151;
        --color-lighter-gray: #1f2937;
        --color-white: #111827;
    }

    body {
        background: #111827;
        color: #f9fafb;
    }

    .card {
        background: #1f2937;
    }

    .form-control {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .form-control::placeholder {
        color: #9ca3af;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
