/* =============================================
   COMPONENTS — Headings, Tables, Cards, Buttons
   ============================================= */

/* ---- Block headings ---- */
.block-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #e8efff;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.2;
}

.block-icon {
    font-size: 1.8rem;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(100, 160, 255, 0.5));
    animation: iconFloat 3.5s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}

.block-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.section-heading {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--blue-bright);
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

/* Highlight spans */
.highlight-blue {
    color: var(--blue);
    font-weight: 600;
}

.highlight-green {
    color: var(--green);
    font-weight: 600;
}

.highlight-purple {
    color: var(--purple);
    font-weight: 600;
}

.highlight-orange {
    color: var(--orange);
    font-weight: 600;
}

/* ---- External links ---- */
.external-link {
    color: inherit;
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, opacity 0.25s ease;
}

.external-link:hover {
    border-bottom-color: currentColor;
    opacity: 0.85;
}

.external-link.highlight-blue,
.external-link.highlight-green,
.external-link.highlight-purple {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---- Rating Cards ---- */
.rating-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 1.5rem;
}

.rating-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: default;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.rating-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--green));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rating-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(100, 160, 255, 0.35);
    box-shadow: 0 12px 30px rgba(100, 160, 255, 0.2);
}

.rating-card:hover::before {
    opacity: 1;
}

.rating-card-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.rating-card-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.rating-card-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Data Tables ---- */
.data-table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 160, 255, 0.3) transparent;
    border-radius: var(--radius-sm);
}

.data-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.data-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.data-table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(100, 160, 255, 0.5), rgba(100, 255, 180, 0.5));
    border-radius: 3px;
}

.data-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background: rgba(14, 20, 55, 0.5);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(100, 160, 255, 0.18);
    font-size: 0.92rem;
}

.data-table thead {
    background: linear-gradient(135deg, rgba(60, 120, 220, 0.2), rgba(60, 200, 140, 0.12));
    border-bottom: 1px solid rgba(100, 160, 255, 0.3);
}

.data-table th {
    padding: 0.9rem 1.1rem;
    text-align: left;
    color: var(--blue-bright);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table th.text-center {
    text-align: center;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(100, 160, 255, 0.08);
    transform: translateX(4px);
}

.data-table td {
    padding: 0.8rem 1.1rem;
    color: rgba(220, 230, 255, 0.92);
    word-wrap: break-word;
    font-size: 0.9rem;
}

.data-table td:first-child {
    white-space: nowrap;
}

.data-table td:nth-child(2) {
    min-width: 190px;
}

.data-table td.text-center {
    text-align: center;
}

/* Medal colors */
.medal-gold {
    color: var(--gold);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.medal-silver {
    color: var(--silver);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.4);
}

.medal-bronze {
    color: var(--bronze);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(205, 127, 50, 0.4);
}

.highlight-cell {
    color: var(--green);
    font-weight: 700;
}

.total-cell {
    color: var(--blue-bright);
    font-weight: 800;
    font-size: 0.95rem;
}

/* Table row reveal animation */
.data-table tbody tr {
    opacity: 0;
    transform: translateX(-10px);
}

.content-block.visible .data-table tbody tr {
    animation: slideInRow 0.4s ease-out forwards;
}

.content-block.visible .data-table tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

.content-block.visible .data-table tbody tr:nth-child(2) {
    animation-delay: 0.10s;
}

.content-block.visible .data-table tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

.content-block.visible .data-table tbody tr:nth-child(4) {
    animation-delay: 0.20s;
}

.content-block.visible .data-table tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

.content-block.visible .data-table tbody tr:nth-child(6) {
    animation-delay: 0.30s;
}

.content-block.visible .data-table tbody tr:nth-child(7) {
    animation-delay: 0.35s;
}

.content-block.visible .data-table tbody tr:nth-child(8) {
    animation-delay: 0.40s;
}

.content-block.visible .data-table tbody tr:nth-child(9) {
    animation-delay: 0.45s;
}

.content-block.visible .data-table tbody tr:nth-child(10) {
    animation-delay: 0.50s;
}

.content-block.visible .data-table tbody tr:nth-child(11) {
    animation-delay: 0.55s;
}

.content-block.visible .data-table tbody tr:nth-child(12) {
    animation-delay: 0.60s;
}

.content-block.visible .data-table tbody tr:nth-child(13) {
    animation-delay: 0.65s;
}

@keyframes slideInRow {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---- Tech Stack ---- */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.25rem;
}

.tech-item {
    background: rgba(100, 160, 255, 0.1);
    border: 1px solid rgba(100, 160, 255, 0.25);
    border-radius: var(--radius-pill);
    padding: 8px 18px;
    font-size: 0.88rem;
    color: var(--blue-bright);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}

.tech-item:hover {
    background: rgba(100, 160, 255, 0.22);
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(100, 160, 255, 0.3);
}

/* ---- Project Cards ---- */
.project-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(100, 160, 255, 0.18);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.project-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(100, 160, 255, 0.08), transparent 30%, transparent, rgba(100, 255, 180, 0.08), transparent 60%);
    animation: rotateBg 9s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card>* {
    position: relative;
    z-index: 2;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(100, 160, 255, 0.4);
    box-shadow: 0 16px 40px rgba(100, 160, 255, 0.2);
}

@keyframes rotateBg {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Social Buttons ---- */
.social-buttons-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.social-button {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 1.5rem;
    background: rgba(100, 160, 255, 0.08);
    border: 1px solid rgba(100, 160, 255, 0.25);
    border-radius: var(--radius-pill);
    color: var(--blue-bright);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(100, 160, 255, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-button:hover::before {
    opacity: 1;
}

.social-button:hover {
    transform: translateY(-3px);
    border-color: rgba(100, 160, 255, 0.55);
    box-shadow: 0 8px 25px rgba(100, 160, 255, 0.25);
}

.social-button-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.github-btn:hover {
    color: var(--green);
    border-color: rgba(100, 255, 180, 0.55);
    box-shadow: 0 8px 25px rgba(100, 255, 180, 0.2);
}

.instagram-btn:hover {
    color: var(--purple);
    border-color: rgba(192, 106, 255, 0.55);
    box-shadow: 0 8px 25px rgba(192, 106, 255, 0.2);
}

.fencingtracker-btn:hover {
    color: var(--orange);
    border-color: rgba(255, 160, 100, 0.55);
    box-shadow: 0 8px 25px rgba(255, 160, 100, 0.2);
}

/* ---- Back to top ---- */
.back-to-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 52px;
    height: 52px;
    background: rgba(14, 20, 55, 0.7);
    border: 1px solid rgba(100, 160, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.back-to-top-btn:hover {
    transform: translateY(-5px) scale(1.1);
    border-color: rgba(100, 160, 255, 0.7);
    box-shadow: 0 10px 30px rgba(100, 160, 255, 0.35);
}

.back-to-top-icon {
    width: 24px;
    height: 24px;
    color: var(--blue-bright);
    transition: all 0.3s ease;
}

.back-to-top-btn:hover .back-to-top-icon {
    color: var(--green);
    transform: translateY(-2px);
}

/* ---- Fixed social links (audio/instagram) ---- */
.social-links {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.social-link {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    gap: 0;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.35);
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.social-link:hover {
    background: rgba(100, 160, 255, 0.2);
    transform: scale(1.05);
}

.social-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
}

.audio-mode-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
    transition: opacity 0.5s ease;
}

/* ---- Favicon in title ---- */
.favicon-in-title {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(100, 160, 255, 0.7));
    animation: faviconPulse 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.favicon-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.block-title:hover .favicon-in-title {
    transform: scale(1.15) rotate(8deg);
}

@keyframes faviconPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 12px rgba(100, 160, 255, 0.6));
    }

    50% {
        filter: drop-shadow(0 0 25px rgba(100, 255, 180, 0.85));
        transform: scale(1.06);
    }
}

/* ---- Achievements row (used in Connect block) ---- */
.achievement-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.25rem 0;
    justify-content: center;
}

.achievement-pill {
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid;
}

.pill-gold {
    color: var(--gold);
    border-color: rgba(255, 215, 0, 0.35);
    background: rgba(255, 215, 0, 0.08);
}

.pill-silver {
    color: var(--silver);
    border-color: rgba(192, 192, 192, 0.35);
    background: rgba(192, 192, 192, 0.08);
}

.pill-bronze {
    color: var(--bronze);
    border-color: rgba(205, 127, 50, 0.35);
    background: rgba(205, 127, 50, 0.08);
}

.pill-blue {
    color: var(--blue);
    border-color: rgba(100, 160, 255, 0.35);
    background: rgba(100, 160, 255, 0.08);
}

/* ---- Scroll progress bar ---- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--green), var(--purple));
    z-index: 1000;
    transition: width 0.08s ease;
    box-shadow: 0 0 8px rgba(100, 160, 255, 0.6);
}

/* ---- Star burst ---- */
.star-burst {
    position: fixed;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 9000;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100, 160, 255, 0.5), rgba(100, 255, 180, 0.3), transparent);
    animation: starBurstExpand 0.6s ease-out forwards;
}

@keyframes starBurstExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* ---- Inline icon utility ---- */
.inline-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin: 0 2px;
    vertical-align: middle;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .social-buttons-container {
        flex-direction: column;
        align-items: stretch;
    }

    .social-button {
        justify-content: center;
    }

    .rating-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }

    .back-to-top-btn {
        width: 46px;
        height: 46px;
        bottom: 20px;
        right: 20px;
    }

    .data-table {
        font-size: 0.85rem;
        min-width: 480px;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.8rem;
    }
}