:root {
    --bg-color: #0d1117;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-keyword: #ff7b72;
    --text-string: #a5d6ff;
    --text-number: #79c0ff;
    --text-comment: #8b949e;

    --festive-red: #ff4444;
    --festive-green: #00C851;

    --glass-bg: rgba(22, 27, 34, 0.7);
    --glass-border: rgba(48, 54, 61, 1);

    --priority-high: rgba(255, 71, 87, 0.85);
    --priority-medium: rgba(255, 165, 2, 0.85);
    --priority-low: rgba(46, 213, 115, 0.85);
}

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

body {
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255, 68, 68, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(0, 200, 81, 0.08) 0%, transparent 50%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    z-index: 10;
    position: relative;
}

/* Терминальный хидер */
.terminal-window {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 200, 81, 0.1);
    animation: slideDown 0.8s ease-out;
    transition: all 0.3s ease;
}

.terminal-window.terminal-minimized .terminal-body {
    display: none;
}

.terminal-window.terminal-maximized {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
    max-width: none;
}

.terminal-header {
    background: #161b22;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.terminal-header span[class^="btn-"] {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.terminal-header span[class^="btn-"]:hover {
    transform: scale(1.2);
}

.btn-close {
    background: #ff5f56;
}

.btn-min {
    background: #ffbd2e;
}

.btn-max {
    background: #27c93f;
}

.terminal-title {
    margin-left: 15px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.terminal-body {
    padding: 20px;
}

.prompt {
    color: var(--festive-green);
    font-weight: bold;
}

.command {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.output-title {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.output-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.output-text::before {
    content: "[OK] ";
    color: var(--festive-green);
}

.term-output-container {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.term-output-container::-webkit-scrollbar {
    width: 8px;
}

.term-output-container::-webkit-scrollbar-track {
    background: transparent;
}

.term-output-container::-webkit-scrollbar-thumb {
    background-color: var(--glass-border);
    border-radius: 4px;
}

.command-input-row {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.input-wrapper {
    flex: 1;
    display: flex;
    margin-left: 10px;
}

.cli-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    caret-color: var(--festive-green);
}

.gift-terminal-card {
    border: 1px dashed var(--glass-border);
    padding: 10px;
    margin: 10px 0;
    background: rgba(22, 27, 34, 0.3);
    border-radius: 4px;
}

.gift-terminal-card.booked {
    border-color: var(--festive-red);
    opacity: 0.6;
}

/* Фильтры */
.filters-container {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(22, 27, 34, 0.5);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.05) inset;
    animation: fadeIn 1s ease-out 0.5s both;
}

.filters-header {
    margin-bottom: 15px;
    color: var(--text-keyword);
    font-weight: bold;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px dashed var(--glass-border);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: rgba(0, 200, 81, 0.15);
    border: 1px solid var(--festive-green);
    color: var(--festive-green);
    text-shadow: 0 0 8px rgba(0, 200, 81, 0.4);
}

/* Сетка подарков */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    flex: 1;
}

.hidden {
    display: none !important;
}

/* Карточки Dev Style */
.dev-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
}

.dev-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--festive-green), var(--festive-red));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}

.dev-card:hover {
    transform: translateY(-5px);
    border-color: #4b535d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.dev-card:hover::before {
    opacity: 1;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #000;
    border-bottom: 1px solid var(--glass-border);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, var(--glass-bg) 110%);
    z-index: 1;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    filter: grayscale(10%) contrast(1.1);
}

.dev-card:hover .card-image {
    transform: scale(1.05);
    filter: grayscale(0%) contrast(1.15);
}

.badge {
    position: absolute;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.priority-badge {
    top: 10px;
    right: 10px;
}

.category-badge {
    top: 10px;
    left: 10px;
    background: rgba(30, 30, 30, 0.8);
    color: var(--text-string);
    border-color: rgba(165, 214, 255, 0.3);
}

.priority-high {
    background-color: var(--priority-high);
    color: white;
}

.priority-medium {
    background-color: var(--priority-medium);
    color: #fff;
}

.priority-low {
    background-color: var(--priority-low);
    color: #fff;
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.4;
}

.code-divider {
    color: var(--text-comment);
    margin: 5px 0 15px;
    font-size: 0.9rem;
}

.code-divider::after {
    content: "/* description */";
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 25px;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed var(--glass-border);
}

.card-price::before {
    content: "cost: ";
    color: var(--text-keyword);
    font-size: 0.85rem;
}

.card-price {
    font-size: 1.1rem;
    color: var(--text-string);
    font-weight: bold;
}

.card-btn {
    text-decoration: none;
    background: rgba(46, 213, 115, 0.1);
    color: var(--festive-green);
    border: 1px solid var(--festive-green);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-btn:hover {
    background: var(--festive-green);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 200, 81, 0.4);
}

.terminal-footer {
    text-align: center;
    margin-top: 50px;
    color: var(--text-comment);
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

/* Снежинки-символы */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.snowflake {
    color: rgba(255, 255, 255, 0.15);
    font-size: 1.2rem;
    position: absolute;
    top: -20px;
    animation: fall linear infinite;
}

.snowflake:nth-child(1) {
    left: 10%;
    animation-duration: 10s;
    animation-delay: 0s;
}

.snowflake:nth-child(2) {
    left: 15%;
    animation-duration: 12s;
    animation-delay: -2s;
    font-size: 1.5rem;
    color: rgba(0, 200, 81, 0.1);
}

.snowflake:nth-child(3) {
    left: 22%;
    animation-duration: 8s;
    animation-delay: -4s;
}

.snowflake:nth-child(4) {
    left: 33%;
    animation-duration: 15s;
    animation-delay: -6s;
    color: rgba(255, 68, 68, 0.1);
}

.snowflake:nth-child(5) {
    left: 40%;
    animation-duration: 11s;
    animation-delay: -1s;
}

.snowflake:nth-child(6) {
    left: 49%;
    animation-duration: 14s;
    animation-delay: -8s;
}

.snowflake:nth-child(7) {
    left: 58%;
    animation-duration: 9s;
    animation-delay: -5s;
    font-size: 1.8rem;
    color: rgba(0, 200, 81, 0.1);
}

.snowflake:nth-child(8) {
    left: 61%;
    animation-duration: 13s;
    animation-delay: -3s;
    color: rgba(255, 68, 68, 0.1);
}

.snowflake:nth-child(9) {
    left: 73%;
    animation-duration: 11s;
    animation-delay: -7s;
}

.snowflake:nth-child(10) {
    left: 85%;
    animation-duration: 14s;
    animation-delay: -9s;
}

.snowflake:nth-child(11) {
    left: 5%;
    animation-duration: 18s;
    animation-delay: -5s;
    font-size: 1rem;
    color: rgba(255, 68, 68, 0.2);
    font-weight: bold;
}

.snowflake:nth-child(12) {
    left: 88%;
    animation-duration: 16s;
    animation-delay: -11s;
    font-size: 1rem;
    color: rgba(255, 68, 68, 0.2);
    font-weight: bold;
}

.snowflake:nth-child(13) {
    left: 25%;
    animation-duration: 19s;
    animation-delay: -14s;
    font-size: 1.1rem;
    color: rgba(255, 165, 2, 0.15);
}

.snowflake:nth-child(14) {
    left: 65%;
    animation-duration: 15s;
    animation-delay: -2s;
    font-size: 1.1rem;
    color: rgba(0, 200, 81, 0.25);
    font-weight: bold;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Лоадер */
.loader {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 150px;
}

.loading-text {
    margin-top: 15px;
    color: var(--text-string);
    animation: pulse 1.5s infinite;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--festive-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .output-title {
        font-size: 1.4rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Кнопка смены темы */
.theme-toggle-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Эффекты для радости: интерактивные частицы */
.sparkle {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    width: 20px;
    height: 20px;
    background-image: radial-gradient(circle, white 10%, transparent 60%);
    animation: sparkleAnim 0.8s ease-out forwards;
}

@keyframes sparkleAnim {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(2) rotate(180deg);
        opacity: 0;
    }
}

/* Печатная машинка для терминала */
.typing-line {
    display: inline-block;
    vertical-align: bottom;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    width: 0;
}

.typing-line.active {
    animation: typing 1s steps(40, end) forwards, blink-caret 0.75s step-end infinite;
}

.typing-line.done {
    width: 100%;
    border-right: none;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--festive-green);
    }
}

/* Минималистичный (Minimal) Режим */
body.minimal-mode {
    background-image: none;
    background-color: #0d1117;
}

body.minimal-mode .snowflakes {
    display: none !important;
}

body.minimal-mode .terminal-window {
    box-shadow: none;
    border: 1px solid #30363d;
    background: #0d1117;
}

body.minimal-mode .dev-card {
    background: #0d1117;
    border: 1px solid #30363d;
    box-shadow: none;
    transform: none !important;
}

body.minimal-mode .dev-card::before {
    display: none;
}

body.minimal-mode .card-image {
    filter: none !important;
    transform: none !important;
}

body.minimal-mode .filters-container {
    background: #0d1117;
    box-shadow: none;
    border: 1px solid #30363d;
}

body.minimal-mode .output-title {
    text-shadow: none;
}