/**
 * CM Portfolio - Frontend Styles
 * Converted from original HTML embedded CSS with dynamic settings support
 */

/* CSS Variables - Will be overridden by inline styles from settings */
:root {
    --cm-neon: #ffd500;
    --cm-dark-bg: #1A1A1A;
    --cm-border: #333;
    --cm-text: #fff;
}

/* Heading Wrapper */
.cm-heading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.cm-vault-tag {
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--cm-neon);
    margin-bottom: 5px;
}

.cm-master-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--cm-text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.cm-master-title .yellow {
    color: var(--cm-neon);
}

.cm-title-glow-line {
    width: 60px;
    height: 3px;
    background: var(--cm-neon);
    margin-top: 10px;
    box-shadow: 0 0 15px var(--cm-neon);
}

/* Main Container */
.cm-portfolio-wrapper {
    padding: 30px 10px;
}

.cm-main-container {
    background: var(--cm-dark-bg);
    border-radius: 25px;
    padding: 20px 15px;
    border: 1px solid var(--cm-border);
    max-width: 1200px;
    margin: 0 auto;
}

/* Category Buttons */
.mission-categories {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.cat-btn {
    padding: 10px 18px;
    background: #222;
    border: 1px solid var(--cm-border);
    border-radius: 20px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
}

.cat-btn:hover {
    border-color: var(--cm-neon);
    color: var(--cm-neon);
}

.cat-btn.active {
    color: var(--cm-neon);
    border-color: var(--cm-neon);
    background: rgba(255, 213, 0, 0.1);
}

/* Display Header */
.display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 5px;
    border-bottom: 1px solid #222;
}

.mission-id {
    font-family: monospace;
    font-size: 10px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
    text-transform: uppercase;
}

.live-indicator {
    font-family: monospace;
    font-size: 9px;
    color: var(--cm-neon);
    font-weight: bold;
    text-transform: uppercase;
}

/* Console Display Frame */
.console-display-frame {
    background: #000;
    border: 1px solid #444;
    padding: 6px;
    position: relative;
    max-width: 950px;
    margin: 0 auto 15px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.display-content {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewport-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mission-media {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.mission-media.active {
    display: block;
}

.cm-video-embed {
    width: 100%;
    height: 100%;
    border: none;
}

/* Unmute Overlay */
.unmute-circle {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    z-index: 999 !important;
    background: var(--cm-neon) !important;
    color: #000 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    display: none;
    /* Controlled by JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 0 20px rgba(255, 213, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none !important;
}

.unmute-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 213, 0, 0.7);
}

.unmute-circle i {
    pointer-events: none;
}

@media (max-width: 767px) {
    .unmute-circle {
        width: 34px !important;
        height: 34px !important;
        top: 15px !important;
        right: 15px !important;
        font-size: 13px;
    }
}

/* Terminal Overlay */
.terminal-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0.3;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 255, 0, 0.02));
    background-size: 100% 3px, 3px 100%;
}

/* Terminal Corners */
.terminal-corner-fixed {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--cm-neon);
    z-index: 10;
    pointer-events: none;
}

.c-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 15px;
}

.c-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 15px;
}

.c-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 15px;
}

.c-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 15px;
}

/* Navigation System */
.nav-scroll-container {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

.tactical-nav-system {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 5px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tactical-nav-system::-webkit-scrollbar {
    display: none;
}

.h-nav-item {
    flex: 0 0 100px;
    height: 75px;
    background: #111;
    border: 1px solid var(--cm-border);
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 0;
}

.h-nav-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.h-nav-item:hover img {
    opacity: 0.7;
}

.h-nav-item.active {
    border-color: var(--cm-neon);
    background: rgba(255, 213, 0, 0.1);
    transform: scale(1.05);
}

.h-nav-item.active img {
    opacity: 1;
}

/* Desktop Grid */
@media (min-width: 768px) {
    .cm-main-container {
        padding: 40px;
    }

    .cm-master-title {
        font-size: 42px;
    }

    .tactical-nav-system {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        overflow: visible;
        gap: 15px;
        padding: 20px 0;
    }

    .h-nav-item {
        flex: 0 0 calc(25% - 15px);
        max-width: 220px;
        height: 110px;
    }
}

/* Glitch Effects */
.glitch-active {
    position: relative;
    overflow: hidden;
    animation: vaultTecBoot 0.7s steps(15) both;
    z-index: 1;
}

@keyframes vaultTecBoot {
    0% {
        transform: scale(1.05) translateY(-15px);
        filter: brightness(3) grayscale(1) sepia(1) hue-rotate(70deg) saturate(15) blur(1px);
    }

    15% {
        transform: scale(0.98) translateY(10px);
        filter: brightness(2) grayscale(1) sepia(1) hue-rotate(75deg) saturate(20);
    }

    30% {
        transform: scale(1.02) translateY(-5px);
        clip-path: inset(10% 0 40% 0);
    }

    45% {
        transform: scale(1) translateY(0);
        clip-path: inset(0 0 0 0);
        filter: brightness(4) grayscale(1) sepia(1) hue-rotate(70deg) saturate(25);
        text-shadow: 0 0 20px #26ff00;
    }

    65% {
        filter: brightness(1.5) grayscale(0.4) sepia(0.1) hue-rotate(20deg) contrast(1.5);
    }

    85% {
        transform: scale(1.01);
        filter: brightness(1.1) contrast(1.1);
    }

    100% {
        transform: scale(1) translateY(0);
        filter: brightness(1) grayscale(0) sepia(0) hue-rotate(0deg) contrast(1);
    }
}

/* Disable animation if set in settings */
.cm-portfolio-wrapper[data-animation-disabled="true"] .glitch-active {
    animation: none !important;
}

/* Blink Animation */
.blink {
    animation: cm-blink 1s infinite;
}

@keyframes cm-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Loading State */
.cm-portfolio-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--cm-neon);
    font-family: monospace;
    font-size: 14px;
    text-transform: uppercase;
}

/* Portfolio Action Center / CTA */
.portfolio-action-center {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 25px;
}

.cm-tactical-btn {
    background: var(--cm-neon);
    color: #000 !important;
    padding: 15px 30px;
    width: 100%;
    max-width: 320px;
    border-radius: 35px;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    display: block;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(255, 213, 0, 0.2);
    border: none;
    cursor: pointer;
}

.cm-tactical-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 213, 0, 0.4);
}

.cm-tactical-btn:active {
    transform: translateY(0) scale(0.98);
}