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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1e1e2e, #3a3a57);
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utility class for hiding elements */
.hidden {
    display: none;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Prevent text selection */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
    animation: fadeIn 1s ease-in;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 3px solid #00eaff;
    animation: fadeIn 1s ease-in;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
    animation: slideInFromTop 0.8s ease-out;
}

.hero p {
    font-size: 1.2rem;
    font-weight: 300;
    color: #b0b0b0;
    animation: slideInFromBottom 0.8s ease-out;
}

/* Navigation */
.tab-container {
    position: sticky;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    width: 80%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.tab {
    flex: 1;
    padding: 15px;
    color: #fff;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
}

.tab:hover {
    color: #00eaff;
}

.tab.active {
    color: #00eaff;
}

.indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: #00eaff;
    border-radius: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Content */
.content-container {
    margin: 40px auto 80px;
    max-width: 800px;
    width: 90%;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
    flex: 1;
}

.content-container.loaded {
    opacity: 1;
}

.content-container h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease;
}

.content-container h2 {
    font-size: 1.8rem;
    margin: 20px 0 10px;
    color: #00eaff;
}

.content-container p, .content-container ul {
    font-size: 1.1rem;
    margin-bottom: 15px;
    animation: fadeInUp 0.8s ease;
}

.content-container ul {
    list-style: none;
    padding-left: 20px;
}

.content-container ul li {
    position: relative;
    margin-bottom: 10px;
}

.content-container ul li::before {
    content: "•";
    color: #00eaff;
    position: absolute;
    left: -20px;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #00eaff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
    display: none;
}

/* CTF Cards */
.ctf-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.ctf-card:hover {
    transform: translateY(-5px);
}

.ctf-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.ctf-card-header {
    margin-bottom: 15px;
}

.ctf-card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ctf-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 500;
}

.ctf-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.ctf-flag {
    width: 20px;
    height: 15px;
}

.ctf-user-details {
    display: flex;
    flex-direction: column;
}

.ctf-username {
    font-weight: 600;
}

.ctf-rank {
    color: #00eaff;
    font-weight: 700;
    text-transform: capitalize;
}

.ctf-points {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctf-sparkles {
    width: 24px;
    height: 24px;
}

.ctf-points-text {
    display: flex;
    flex-direction: column;
}

.ctf-points-label {
    font-size: 0.9rem;
    color: #b0b0b0;
}

.ctf-points-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.ctf-card-content a {
    color: #00eaff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.ctf-card-content a:hover {
    color: #007bff;
}

.ctf-profile-link a {
    color: #00eaff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.ctf-profile-link a:hover {
    color: #007bff;
}

.ctf-qr {
    width: 150px;
    height: 150px;
    margin: 15px 0;
    border-radius: 10px;
}

.tryhackme-badge {
    display: block;
    margin: 15px auto;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 15px;
    text-align: center;
    z-index: 1000;
    animation: slideInFromBottom 0.8s ease-out;
}

.social-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

.social-links a {
    color: #fff;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: #00eaff;
    transform: scale(1.2) rotate(10deg);
}

footer p {
    font-size: 0.8rem;
    font-weight: 300;
    color: #b0b0b0;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

#theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

#theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(20deg);
}

#theme-toggle-btn:focus {
    outline: 2px solid #00eaff;
    outline-offset: 2px;
}

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 70px;
    right: 30px;
    background: #00eaff;
    color: #000;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    z-index: 1001;
}

#back-to-top.visible {
    opacity: 1;
}

#back-to-top:hover {
    transform: scale(1.1);
}

#back-to-top:focus {
    outline: 2px solid #00eaff;
    outline-offset: 2px;
}

/* Dark Mode */
body.dark {
    background: linear-gradient(135deg, #0a0a0f, #1a1a2e);
}

body.dark .tab-container {
    background: rgba(0, 0, 0, 0.3);
}

body.dark .tab {
    background: none;
}

body.dark .content-container p,
body.dark .content-container ul {
    color: #e0e0e0;
}

body.dark .ctf-card {
    background: rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInFromTop {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

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

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

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        padding: 60px 15px 40px;
    }

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

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .tab-container {
        width: 90%;
        max-width: 700px;
        padding: 3px;
        top: 20px;
    }

    .tab {
        padding: 12px;
        font-size: 1rem;
    }

    .content-container {
        width: 92%;
        margin: 30px auto;
        padding: 15px;
    }

    .content-container h1 {
        font-size: 2rem;
    }

    .content-container h2 {
        font-size: 1.5rem;
    }

    #back-to-top {
        bottom: 70px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 40px 10px 30px;
    }

    .profile-photo {
        width: 100px;
        height: 100px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .tab-container {
        position: relative;
        margin: 20px auto;
        width: 80%;
        max-width: 300px;
        flex-direction: column;
        border-radius: 20px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tab {
        padding: 12px;
        margin: 5px 0;
        width: 100%;
        max-width: 250px;
        text-align: center;
        border-radius: 0;
        font-size: 1rem;
        background: none;
        border: none;
        transition: color 0.3s ease;
    }

    .tab:hover {
        color: #00eaff;
    }

    .tab.active {
        color: #00eaff;
    }

    .indicator {
        display: none;
    }

    .content-container {
        width: 95%;
        margin: 20px auto;
        padding: 10px;
        margin-top: 20px;
    }

    .content-container h1 {
        font-size: 1.8rem;
    }

    .content-container h2 {
        font-size: 1.3rem;
    }

    .content-container p, .content-container ul {
        font-size: 1rem;
    }

    .ctf-card {
        padding: 15px;
    }

    .ctf-card h3 {
        font-size: 1.3rem;
    }

    .ctf-qr {
        width: 120px;
        height: 120px;
    }

    .ctf-user-info {
        font-size: 1rem;
    }

    .ctf-avatar {
        width: 35px;
        height: 35px;
    }

    .ctf-flag {
        width: 18px;
        height: 13px;
    }

    .ctf-points {
        gap: 8px;
    }

    .ctf-sparkles {
        width: 20px;
        height: 20px;
    }

    .ctf-points-label {
        font-size: 0.8rem;
    }

    .ctf-points-value {
        font-size: 1rem;
    }

    .tryhackme-badge {
        max-width: 80%;
    }

    .theme-toggle {
        top: 15px;
        right: 15px;
    }

    #theme-toggle-btn {
        font-size: 1.3rem;
        padding: 8px;
    }

    #back-to-top {
        bottom: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    footer {
        position: static;
        margin-top: auto;
        padding: 15px;
    }

    .social-links {
        gap: 15px;
    }

    .social-links a {
        font-size: 1.3rem;
    }
}

/* Modern CV Download Button */
.modern-cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    padding: 14px 30px;
    background: linear-gradient(135deg, #00eaff 0%, #007bff 100%);
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 234, 255, 0.4), inset 0 2px 4px rgba(255, 255, 257, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    z-index: 1;
}

.modern-cv-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.modern-cv-btn:hover::before {
    width: 300px;
    height: 300px;
}

.modern-cv-btn:hover {
    color: #fff;
    background: linear-gradient(135deg, #00eaff 0%, #005bbb 100%);
    box-shadow: 0 12px 25px rgba(0, 234, 255, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    transform: translateY(-4px) scale(1.05);
}

.modern-cv-btn:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 10px rgba(0, 234, 255, 0.2);
}

.modern-cv-btn:focus {
    outline: 2px solid #00eaff;
    outline-offset: 2px;
}

.modern-cv-btn span {
    position: relative;
    z-index: 2;
}

.modern-cv-btn i {
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.modern-cv-btn:hover i {
    transform: translateY(2px);
}

/* Dark mode adjustments */
body.dark .modern-cv-btn {
    background: linear-gradient(135deg, #00c4cc 0%, #004f99 100%);
}

body.dark .modern-cv-btn:hover {
    background: linear-gradient(135deg, #00c4cc 0%, #003366 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modern-cv-btn {
        padding: 12px 25px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .modern-cv-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
}
