/* Root Variables */
:root {
    --tokyo-dark: #1a1b26;
    --tokyo-dark-lighter: #24283b;
    --tokyo-blue: #7aa2f7;
    --tokyo-purple: #bb9af7;
    --tokyo-cyan: #7dcfff;
    --tokyo-green: #9ece6a;
    --tokyo-text: #a9b1d6;
    --tokyo-text-lighter: #c0caf5;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Coding Profiles Section */
.coding-profiles {
    background-color: var(--tokyo-dark);
    padding: 4rem 0;
    overflow: hidden;
}

.coding-profiles h2 {
    color: var(--tokyo-blue);
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    font-weight: 600;
}

/* Container and Row Layout */
.profiles-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.profiles-row {
    display: grid;
    gap: 2.5rem;
}

/* First row - 3 cards */
.profiles-row:first-child {
    grid-template-columns: repeat(3, 1fr);
}

/* Second row - 2 cards */
.profiles-row:last-child {
    grid-template-columns: repeat(2, 1fr);
}

/* Row Divider */
.row-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--tokyo-blue),
        var(--tokyo-purple),
        var(--tokyo-blue),
        transparent
    );
    background-size: 200% 100%;
    animation: gradientFlow 3s ease infinite;
    margin: 1rem 0;
}

/* Profile Cards */
.coding-profile-card {
    background: var(--tokyo-dark-lighter);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(122, 162, 247, 0.1);
    transition: var(--transition);
    border: 1px solid rgba(122, 162, 247, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.coding-profile-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(122, 162, 247, 0.2);
    border-color: rgba(122, 162, 247, 0.3);
}

/* Card Images */
.coding-profile-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: transform 0.4s ease;
}

.coding-profile-card:hover img {
    transform: scale(1.02);
}

/* Card Headers */
.coding-profile-card h3 {
    color: var(--tokyo-purple);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    position: relative;
    display: inline-block;
}

.coding-profile-card h3::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 40px;
    height: 2px;
    background: var(--tokyo-blue);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.coding-profile-card:hover h3::after {
    width: 60px;
}

/* Stats Section */
.stats {
    background: rgba(122, 162, 247, 0.1);
    padding: 1.2rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 1px solid rgba(122, 162, 247, 0.2);
    width: 100%;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.stats p {
    color: var(--tokyo-text);
    margin: 0.5rem 0;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
}

.stats span {
    color: var(--tokyo-text-lighter);
    font-weight: 500;
}

/* Profile Links */
.profile-link {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #414868;
    color: var(--tokyo-text-lighter);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
    border: 1px solid transparent;
}

.profile-link:hover {
    background: var(--tokyo-blue);
    color: var(--tokyo-dark);
    transform: translateY(-2px);
}

/* Overall Stats Card */
.coding-profile-card[data-platform="overall"] {
    background: linear-gradient(
        145deg,
        var(--tokyo-dark-lighter),
        rgba(36, 40, 59, 0.8)
    );
}

.overall-badges {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(122, 162, 247, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(122, 162, 247, 0.1);
    width: 100%;
}

.overall-badges p {
    color: var(--tokyo-text);
    margin: 0.5rem 0;
    font-size: 0.95rem;
    text-align: left;
    padding: 0.5rem;
}

/* CodeChef Card Specific */
.coding-profile-card[data-platform="codechef"] {
    padding-top: 3rem;
}

/* Hover Effects */
.coding-profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: linear-gradient(45deg, 
        rgba(122, 162, 247, 0.1),
        rgba(187, 154, 247, 0.1)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.coding-profile-card:hover::before {
    opacity: 1;
}

/* Animations */
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AOS Animation Classes */
[data-aos="fade-right"] {
    transform: translateX(-50px);
    opacity: 0;
    transition-property: transform, opacity;
}

[data-aos="fade-left"] {
    transform: translateX(50px);
    opacity: 0;
    transition-property: transform, opacity;
}

[data-aos="fade-up"] {
    transform: translateY(50px);
    opacity: 0;
    transition-property: transform, opacity;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .profiles-row:first-child {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profiles-row:last-child {
        grid-template-columns: repeat(2, 1fr);
    }

    .coding-profiles h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .profiles-row:first-child,
    .profiles-row:last-child {
        grid-template-columns: 1fr;
    }

    .coding-profiles {
        padding: 3rem 0;
    }

    .coding-profiles h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .row-divider {
        margin: 0.5rem 0;
    }

    .coding-profile-card {
        padding: 1.5rem;
    }

    /* Disable animations on mobile */
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .coding-profiles {
        padding: 2rem 0;
    }

    .profiles-container {
        padding: 0 15px;
    }

    .stats {
        padding: 1rem;
    }

    .stats p {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }

    .profile-link {
        padding: 0.7rem 1.2rem;
    }

    .coding-profile-card h3 {
        font-size: 1.2rem;
    }
}

/* Dark Mode Enhancement */
@media (prefers-color-scheme: dark) {
    .coding-profile-card {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Print Styles */
@media print {
    .coding-profiles {
        background: white;
        color: black;
    }

    .profile-link {
        display: none;
    }

    .row-divider {
        border-top: 1px solid #ccc;
        background: none;
    }
}