:root {
    --bg-color: #fafafa;
    --text-color: #262626;
    --secondary-text: #8e8e8e;
    --border-color: #dbdbdb;
    --primary-blue: #0095f6;
    --link-color: #00376b;
    --card-bg: #ffffff;
    --nav-bg: #ffffff;
    --max-width: 935px;
}

body.dark-mode {
    --bg-color: #000000;
    --text-color: #f5f5f5;
    --secondary-text: #a8a8a8;
    --border-color: #262626;
    --primary-blue: #0095f6;
    --link-color: #e0f1ff;
    --card-bg: #000000;
    --nav-bg: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Top Navigation */
.top-nav {
    height: 60px;
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
}

.nav-icons {
    display: flex;
    gap: 20px;
    color: var(--text-color);
}

.nav-icon {
    cursor: pointer;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 20px 30px; /* Increased top padding to clear nav */
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 44px;
    gap: 30px;
}

.profile-pic-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

.gradient-ring {
    padding: 3px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    cursor: pointer;
}

.gradient-ring:hover {
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 0 20px rgba(220, 39, 67, 0.4);
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
}

.profile-info {
    flex: 2;
}

.profile-top {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.username {
    font-size: 28px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
}

.verified-badge svg {
    margin-top: 5px;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.btn-follow {
    background-color: #0095f6;
    color: white;
    border: none;
    padding: 6px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cv {
    background-color: transparent;
    border: 1px solid #dbdbdb;
    color: var(--text-color);
    padding: 6px 15px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.header-options {
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
}

.profile-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
}

.profile-stats span {
    font-size: 16px;
    color: var(--text-color);
}

.profile-stats strong {
    font-weight: 600;
}

.profile-bio p {
    font-size: 14px;
    margin-bottom: 3px;
}

.full-name {
    font-weight: 600;
}

.title {
    color: var(--secondary-text);
}

.description {
    max-width: 500px;
    line-height: 1.4;
    margin-bottom: 10px !important;
}

.bio-links {
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bio-links a {
    color: #00376b;
    text-decoration: none;
    font-weight: 600;
}

.bio-links a:hover {
    text-decoration: underline;
}

/* Highlights Row */
.highlights-row {
    display: flex;
    gap: 30px;
    margin-bottom: 44px;
    padding-left: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.highlights-row::-webkit-scrollbar {
    display: none;
}

.highlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.highlight-circle {
    width: 77px;
    height: 77px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--nav-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s;
}

.highlight-circle:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-blue);
}

.highlight-circle img {
    max-width: 100%;
}

.highlight span {
    font-size: 12px;
    font-weight: 500;
}

/* Tabs */
.profile-tabs {
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 0;
}

.tab {
    padding: 15px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-text);
    cursor: pointer;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tab.active {
    color: var(--text-color);
    border-top: 1px solid var(--text-color);
    margin-top: -1px;
}

.tab svg {
    fill: currentColor;
}

/* Grid Refined as Feed Card */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    padding-bottom: 60px;
}

.feed-card {
    background-color: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px; /* Instagram cards have sharp-ish corners */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out backwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

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

/* Staggered card animations */
.feed-card:nth-child(1) { animation-delay: 0.1s; }
.feed-card:nth-child(2) { animation-delay: 0.2s; }
.feed-card:nth-child(3) { animation-delay: 0.3s; }
.feed-card:nth-child(4) { animation-delay: 0.4s; }
.feed-card:nth-child(5) { animation-delay: 0.5s; }
.feed-card:nth-child(6) { animation-delay: 0.6s; }
.feed-card:nth-child(7) { animation-delay: 0.7s; }
.feed-card:nth-child(8) { animation-delay: 0.8s; }
.feed-card:nth-child(9) { animation-delay: 0.9s; }

.card-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 12px;
    justify-content: space-between;
}

.card-header-info {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-options {
    font-size: 18px;
    color: var(--text-color);
    cursor: pointer;
    margin-right: 4px;
}

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.card-username {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.verified-badge-mini {
    display: flex;
    align-items: center;
}

.action-icon svg {
    display: block;
}

.action-icon.heart.active svg path {
    fill: #ed4956;
    stroke: #ed4956;
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #efefef;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-footer {
    padding: 10px 12px;
}

.action-icons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 20px;
}

.left-actions {
    display: flex;
    gap: 15px;
}

.action-icon {
    cursor: pointer;
}

.action-icon.heart:hover {
    color: #ed4956;
}

.likes-count {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.caption {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 3px;
}

.more {
    color: var(--secondary-text);
    cursor: pointer;
}

.hashtags {
    color: #00376b;
    font-size: 14px;
    margin-bottom: 5px;
}

.view-comments {
    color: var(--secondary-text);
    font-size: 14px;
    margin-bottom: 5px;
}

.date {
    font-size: 10px;
    color: var(--secondary-text);
    text-transform: uppercase;
}

/* Contact Section */
.contact-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.section-title {
    margin-bottom: 30px;
    font-weight: 300;
    font-size: 24px;
}

#contact-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#contact-form input, #contact-form textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

#contact-form textarea {
    height: 120px;
    resize: vertical;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: auto;
}

.modal-content {
    background-color: var(--nav-bg);
    margin: 5% auto;
    width: 80%;
    max-width: 935px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
    color: #999;
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
}

.modal-image {
    flex: 1.5;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image img {
    max-width: 100%;
    max-height: 600px;
}

.modal-details {
    flex: 1;
    padding: 30px;
}

.modal-details h2 {
    margin-bottom: 20px;
}

.modal-details p {
    color: #444;
    margin-bottom: 20px;
}

.modal-features {
    list-style: none;
    margin-bottom: 30px;
}

.modal-features li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
}

.modal-features li::before {
    content: '✔';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .profile-pic-wrapper {
        flex: none;
    }

    .profile-pic {
        width: 120px;
        height: 120px;
    }

    .profile-info {
        flex: none;
        width: 100%;
    }
    
    .profile-top {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .profile-stats {
        justify-content: center;
        gap: 30px;
        border-top: 1px solid var(--border-color);
        padding: 12px 0;
        margin-bottom: 0;
    }
    
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Empty Views & Tab Content */
.empty-view {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
    color: var(--text-color);
}

.empty-icon {
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-view h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.empty-view p {
    color: var(--secondary-text);
    font-size: 16px;
    max-width: 400px;
}

.coming-soon {
    margin-top: 15px;
    font-weight: 600;
    color: var(--primary-blue) !important;
}

.highlight {
    cursor: pointer;
    transition: transform 0.2s;
}

/* Footer */
.site-footer {
    max-width: var(--max-width);
    margin: 60px auto 40px;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--secondary-text);
    text-decoration: none;
    font-size: 12px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-copyright {
    color: var(--secondary-text);
    font-size: 12px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Mobile Responsive Extra (480px) */
@media (max-width: 480px) {
    .container {
        padding-top: 30px;
    }

    .profile-header {
        margin-bottom: 20px;
    }

    .profile-pic {
        width: 90px;
        height: 90px;
    }

    .username {
        font-size: 20px;
    }

    .header-buttons {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .btn-follow, .btn-cv {
        flex: 1;
        max-width: 150px;
        padding: 8px 0;
    }

    .profile-stats {
        padding: 15px 0;
        gap: 0;
        display: flex;
        justify-content: space-around;
    }

    .profile-stats span {
        font-size: 14px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-stats strong {
        display: block;
    }

    .profile-bio {
        text-align: left;
        width: 100%;
        padding: 0 15px;
    }

    .profile-bio p {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 0;
        border-top: 1px solid var(--border-color);
    }

    .feed-card {
        border-left: none;
        border-right: none;
        border-radius: 0;
        margin-bottom: 0;
    }

    .highlights-row {
        gap: 15px;
        padding-left: 15px;
        padding-bottom: 15px;
    }

    .highlight-circle {
        width: 64px;
        height: 64px;
        padding: 12px;
    }

    /* Refined Mobile Modal */
    .modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .modal-body {
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
    }

    .modal-image {
        flex: none;
        width: 100%;
        /* Ensure the image doesn't take too much initial height */
        max-height: 40vh;
    }

    .modal-details {
        padding: 20px;
        padding-bottom: 60px; /* Space for scrolling */
    }

    .modal-details h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .close-btn {
        background: rgba(255, 255, 255, 0.8);
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        top: 15px;
        right: 15px;
        border-radius: 50%;
        font-size: 24px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        color: #000;
    }
}
