/* Modern About page styles with animations */

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Page entry animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.about-container > * {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.about-container > *:nth-child(2) { animation-delay: 0.2s; }
.about-container > *:nth-child(3) { animation-delay: 0.4s; }
.about-container > *:nth-child(4) { animation-delay: 0.6s; }

/* Enhanced Language switcher */
.language-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.lang-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 30px; /* Rounded buttons */
    font-weight: 600;
    border: 2px solid var(--border-color);
    background-color: transparent;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: var(--accent-color);
    transition: all 0.3s ease-in-out;
    z-index: -1;
}

.lang-btn:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.2);
}

.lang-btn:hover::before {
    width: 100%;
}

.lang-btn.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.25);
}

/* Modern About header with animated elements */
.about-header {
    margin-bottom: 4rem;
    text-align: center;
    position: relative;
}

.about-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    border-radius: 2px;
}

.about-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--accent-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.about-header p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* About sections with scroll animations */
.about-section {
    margin-bottom: 5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.about-section.animated {
    opacity: 1;
    transform: translateY(0);
}

.about-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.about-section h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.7rem;
    width: 0px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--info-color));
    border-radius: 2px;
    transition: width 0.6s ease-out 0.2s;
}

.about-section.animated h2::after {
    width: 100px;
}

/* Modern card design with hover effects */
.about-card {
    background: linear-gradient(145deg, var(--bg-secondary), rgba(var(--accent-color-rgb), 0.03));
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(var(--accent-color-rgb), 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(var(--accent-color-rgb), 0.1);
    z-index: 0;
    transition: all 0.5s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.about-card:hover::before {
    transform: scale(20);
    opacity: 0.4;
}

.about-card p {
    color: var(--text-primary);
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

/* Animated values list */
.values-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.values-list li {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s ease;
}

.values-list li.animated {
    opacity: 1;
    transform: translateX(0);
}

.value-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.8), rgba(var(--info-color-rgb), 0.8));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.2);
}

.values-list li:hover .value-icon {
    transform: rotateY(180deg);
}

/* Revamped services grid with card flip effect */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.service-item {
    border-radius: 12px;
    height: 200px;
    perspective: 1000px;
    position: relative;
}

.service-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.service-item:hover .service-inner {
    transform: rotateY(180deg);
}

.service-front, .service-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.service-front {
    background: linear-gradient(145deg, var(--bg-secondary), rgba(var(--accent-color-rgb), 0.05));
    border: 1px solid var(--border-color);
}

.service-back {
    background: linear-gradient(145deg, var(--accent-color), rgba(var(--info-color-rgb), 0.9));
    color: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.service-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), rgba(var(--info-color-rgb), 0.8));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.2rem;
    box-shadow: 0 10px 20px rgba(var(--accent-color-rgb), 0.25);
    transition: all 0.3s ease;
}

.service-item:hover .service-icon {
    transform: scale(1.1) rotate(10deg);
}

.service-back h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.service-back p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Animated button */
.btn-primary {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--accent-color), rgba(var(--info-color-rgb), 0.9));
    color: white;
    border-radius: 30px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(var(--accent-color-rgb), 0.4);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--info-color-rgb), 0.9), var(--accent-color));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-primary:hover::after {
    opacity: 1;
}

/* Floating animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating-element {
    animation: float 3s ease-in-out infinite;
}

/* Bangla font adjustments */
html[lang="bn"] {
    font-family: 'Hind Siliguri', sans-serif;
}

html[lang="bn"] .about-header h1 {
    font-size: 2.2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .about-header h1 {
        font-size: 2.2rem;
    }
    
    .about-header p {
        font-size: 1.1rem;
    }
    
    .about-section h2 {
        font-size: 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-item {
        height: 180px;
    }
}

/* Mobile-specific service card styling */
.service-mobile {
    background: linear-gradient(145deg, var(--bg-secondary), rgba(var(--accent-color-rgb), 0.05));
    padding: 1.2rem;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.service-mobile .service-desc {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--accent-color-rgb), 0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toggle-desc {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(var(--accent-color-rgb), 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-desc:hover {
    background: rgba(var(--accent-color-rgb), 0.2);
    transform: scale(1.1);
}

/* Enhanced responsive adjustments */
@media (max-width: 768px) {
    .about-header h1 {
        font-size: 2rem;
    }
    
    .about-section h2 {
        font-size: 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .about-card {
        padding: 1.25rem;
    }
    
    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Adjust spacing for mobile */
    .about-section {
        margin-bottom: 3rem;
    }
    
    .about-header {
        margin-bottom: 2.5rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .about-header h1 {
        font-size: 1.8rem;
    }
    
    .about-header p {
        font-size: 1rem;
    }
    
    .values-list li {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .value-icon {
        margin-bottom: 0.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .language-switcher {
        justify-content: center;
    }
    
    /* Optimize card padding */
    .about-card {
        padding: 1rem;
    }
    
    /* Make buttons easier to tap on mobile */
    .btn-primary {
        padding: 0.8rem 1.25rem;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .lang-btn {
        padding: 0.5rem 1.2rem;
    }
}

/* Orientation-specific adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .about-header {
        margin-bottom: 1.5rem;
    }
    
    .about-header h1 {
        font-size: 1.6rem;
    }
    
    .about-header p {
        font-size: 0.9rem;
    }
    
    .about-section {
        margin-bottom: 2rem;
    }
    
    /* Adjust spacing in landscape orientation on small devices */
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin: 0 auto 0.7rem;
    }
}

/* Fix for iOS Safari momentum scrolling */
html, body {
    -webkit-overflow-scrolling: touch;
}

/* 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;
        scroll-behavior: auto !important;
    }
    
    .floating-element {
        animation: none !important;
    }
    
    .about-container > * {
        animation: none !important;
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    .values-list li {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .language-switcher {
        justify-content: center;
    }
}
