:root {
    --bg-dark: #05080c;
    --card-glass: rgba(10, 16, 26, 0.65);
    --accent-orange: #ff7900;
    --accent-orange-dim: rgba(255, 121, 0, 0.15);
    --text-main: #f0f4f8;
    --text-muted: #7e8b9b;
    --border-cyan: rgba(255, 121, 0, 0.25);
    --border-hover: #ff7900;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.01) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, rgba(255, 121, 0, 0.04) 0%, var(--bg-dark) 75%);
    z-index: -1;
}

.container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 24px;
    flex: 1;
}

.tactical-header {
    text-align: center;
    margin-bottom: 60px;
}

.header-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-orange), transparent);
    width: 60%;
    margin: 12px auto;
    opacity: 0.5;
}

.main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--accent-orange);
    letter-spacing: 4px;
    font-weight: 700;
    margin-top: 8px;
}

.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 35px;
}

.mission-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.mission-card {
    background: var(--card-glass);
    border-left: 3px solid var(--border-cyan);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mission-card:hover {
    border-left-color: var(--border-hover);
    background: rgba(14, 23, 38, 0.85);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(255, 121, 0, 0.1);
    transform: translateY(-4px);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 52%;
    overflow: hidden;
    background: #020406;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    filter: grayscale(15%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
}

.card-blur-edge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, rgba(10, 16, 26, 1), transparent);
}

.mission-card:hover .card-image {
    transform: scale(1.03);
    opacity: 0.95;
    filter: grayscale(0%);
}

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.title-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.mission-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-orange);
    opacity: 0.8;
}

.mission-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.mission-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 24px;
    flex-grow: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 25px;
}

.tag {
    background: rgba(255, 121, 0, 0.05);
    border: 1px solid rgba(255, 121, 0, 0.15);
    color: #e2e8f0;
    padding: 3px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.info-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.2s ease;
}

.mission-card:hover .info-btn {
    border-color: var(--accent-orange);
    background: var(--accent-orange-dim);
    color: var(--accent-orange);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 4, 7, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px; 
}

.modal-overlay:target {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: #090e14;
    border: 1px solid var(--accent-orange);
    width: 100%;
    max-width: 680px;
    position: relative;
    box-shadow: 0 0 50px rgba(255, 121, 0, 0.15);
    animation: modalZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden; 
}
@keyframes modalZoom {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ffffff;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.2rem;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--accent-orange);
    color: #000000;
    border-color: var(--accent-orange);
}

.modal-header-img {
    position: relative;
    width: 100%;
    height: 240px;
    flex-shrink: 0;
    background: #000;
}

.modal-header-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.modal-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #090e14, transparent 60%);
}

.modal-body {
    padding: 35px;
}

.modal-title-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent-orange);
}

.modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 25px;
}

.modal-description {
    position: relative;
    padding-left: 20px;
    margin-bottom: 35px;
}

.desc-bracket {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-orange);
    opacity: 0.7;
}

.modal-description p {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.6;
}

.warning-text {
    color: #ff3e3e;
    font-weight: 600;
}

.download-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--accent-orange);
    color: #000000;
    border: none;
    padding: 16px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-decoration: none;
    overflow: hidden;
    transition: background 0.2s;
}

.download-btn i {
    margin-right: 12px;
    font-size: 1.1rem;
}

.download-btn:hover {
    background: #ff9130;
    box-shadow: 0 0 20px rgba(255, 121, 0, 0.4);
}

.tactical-footer {
    background: #020406;
    padding: 25px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    margin-top: auto;
}

.tactical-footer p {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    width: 100%;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: var(--card-glass);
    border: 1px solid var(--border-cyan);
    display: flex;
    align-items: center;
    padding: 6px 20px;
    transition: all 0.3s ease;
}

.search-wrapper:focus-within {
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(255, 121, 0, 0.15);
}

.search-icon {
    color: var(--accent-orange);
    font-size: 1.1rem;
    margin-right: 15px;
    opacity: 0.8;
}

.btn-tactical-header {
    position: absolute;
    top: 30px;
    right: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 121, 0, 0.02);
    border: 1px solid rgba(255, 121, 0, 0.25);
    color: #ff7900;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 10px 18px;
    text-decoration: none;
    letter-spacing: 1.5px;
    border-radius: 3px;
    text-transform: uppercase;
    transition: all 0.2s ease-in-out;
    z-index: 10;
}

.btn-tactical-header:hover {
    background: rgba(255, 121, 0, 0.1);
    border-color: #ff7900;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 121, 0, 0.25);
}

#missionSearch {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
    padding: 10px 0;
}

#missionSearch::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
    font-size: 0.9rem;
}

@media (max-height: 700px), (max-width: 600px) {
    .modal-header-img {
        height: 150px;
    }
    .modal-body {
        padding: 20px !important;
    }
    .modal-title {
        font-size: 1.5rem !important;
    }
    .btn-tactical-header {
        position: relative;
        top: 0;
        right: 0;
        transform: none;
        margin-top: 10px;
    }