/* ==================== ADVANCED ANIMATIONS ==================== */

/* ==================== LOADING SCREEN ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-ring:nth-child(1) {
    animation-delay: -0.45s;
    border-top-color: #6366f1;
}

.loader-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #8b5cf6;
    width: 80%;
    height: 80%;
}

.loader-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: #ec4899;
    width: 60%;
    height: 60%;
}

.loader-text {
    font-size: 1rem;
    color: #f1f5f9;
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ==================== ACHIEVEMENTS SECTION ==================== */
.achievements {
    background: var(--dark-bg);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.achievement-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--primary-color) 90deg,
        transparent 180deg
    );
    animation: rotateBorder 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-card:hover::before {
    opacity: 0.3;
}

.achievement-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

@keyframes rotateBorder {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.achievement-image {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
}

.achievement-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    position: relative;
    z-index: 2;
}

.achievement-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-glow);
    z-index: 3;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.achievement-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.achievement-issuer {
    color: var(--gray-text);
    margin-bottom: 0.5rem;
}

.achievement-date {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.achievement-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.achievement-link:hover {
    gap: 1rem;
    color: var(--secondary-color);
}

/* ==================== SERVICES SECTION ==================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: var(--gradient-1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: rotateY(360deg);
    box-shadow: var(--shadow-glow);
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--light-text);
}

.service-description {
    color: var(--gray-text);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.service-features {
    list-style: none;
    text-align: left;
}

.service-features li {
    padding: 0.5rem 0;
    color: var(--gray-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-features li i {
    color: var(--primary-color);
}

/* ==================== TESTIMONIALS SECTION ==================== */
.testimonials {
    background: rgba(30, 41, 59, 0.3);
}

.testimonials-slider {
    position: relative;
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 2rem 0;
    scrollbar-width: none;
}

.testimonials-slider::-webkit-scrollbar {
    display: none;
}

.testimonial-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .testimonial-card {
        flex: 0 0 calc(50% - 1rem);
    }
}

@media (min-width: 1024px) {
    .testimonial-card {
        flex: 0 0 calc(33.333% - 1.5rem);
    }
}

.testimonial-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.quote-icon {
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.testimonial-text {
    color: var(--light-text);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.testimonial-rating {
    color: #fbbf24;
    margin-bottom: 2rem;
}

.testimonial-rating i {
    margin-right: 0.25rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.author-name {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--light-text);
}

.author-position {
    color: var(--gray-text);
    font-size: 0.9rem;
}

.slider-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.slider-btn {
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* ==================== BLOG SECTION ==================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-grid-two-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 968px) {
    .blog-grid-two-cols {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.blog-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.blog-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-image img {
    transform: scale(1.1);
}

.blog-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.blog-content {
    padding: 2rem;
}

.blog-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    color: var(--gray-text);
    font-size: 0.9rem;
}

.blog-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--light-text);
    line-height: 1.4;
}

.blog-excerpt {
    color: var(--gray-text);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.blog-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.blog-link:hover {
    gap: 1rem;
    color: var(--secondary-color);
}

/* ==================== ADDITIONAL ANIMATIONS ==================== */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.6s ease forwards;
}

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.8s ease forwards;
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.8s ease forwards;
}

/* Flip In */
@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(-90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

.flip-in {
    animation: flipIn 0.8s ease forwards;
}

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 5px var(--primary-color));
    }
    50% {
        filter: drop-shadow(0 0 20px var(--primary-color));
    }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

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

.shake {
    animation: shake 0.5s ease;
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-10deg);
    }
    20%, 40% {
        transform: rotate(10deg);
    }
}

.wave {
    animation: wave 1s ease infinite;
    transform-origin: 70% 70%;
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 3s steps(40) forwards;
}

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

/* Responsive Animations */
@media (max-width: 968px) {
    .achievement-card,
    .service-card,
    .testimonial-card,
    .blog-card {
        animation: none !important;
    }

    .achievement-card:hover,
    .service-card:hover,
    .testimonial-card:hover,
    .blog-card:hover {
        transform: translateY(-5px);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}