/* ==================== WINDOWS 95 AUTHENTIC DESIGN ==================== */
/* Full Windows 95 Desktop Experience with Modern Responsive Features */

/* Windows 95 Authentic Bitmap Fonts - CRITICAL: Use specific sizes only */

/* Latin characters - W95FA */
@font-face {
    font-family: 'W95FA';
    src: url('/static/fonts/w95fa.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
    unicode-range: U+0020-007F, U+00A0-00FF; /* Latin */
}

/* Cyrillic characters - DOS VGA */
@font-face {
    font-family: 'W95FA';
    src: url('/static/fonts/MorePerfectDOSVGA-Cyrillic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
    unicode-range: U+0400-04FF, U+0500-052F; /* Cyrillic */
}

/* IBM VGA Cyrillic fallback */
@font-face {
    font-family: 'IBM VGA Cyrillic';
    src: url('/static/fonts/WebPlus_IBM_VGA_8x16.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Fixedsys';
    src: url('/static/fonts/Fixedsys.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'MS Sans Serif 8pt';
    src: url('/static/fonts/MSSansSerif.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
    /* Force specific size for pixel-perfect rendering */
    size-adjust: 100%;
}

:root {
    /* Windows 95 Classic Colors */
    --win-gray: #c0c0c0;
    --win-border-light: #ffffff;
    --win-border-dark: #808080;
    --win-border-darkest: #000000;
    --win-title-active: #000080;
    --win-title-inactive: #808080;
    --win-desktop: #008080; /* Classic Teal */
    --win-start-green: #008000;
    
    /* Text Colors */
    --text-primary: #000000;
    --text-white: #ffffff;
    --text-gray: #808080;
    
    /* Button States */
    --btn-face: #c0c0c0;
    --btn-shadow: #808080;
    --btn-dark-shadow: #000000;
    --btn-highlight: #ffffff;
    --btn-light: #dfdfdf;
    
    /* Windows 95 Bitmap Fonts - W95FA with Cyrillic support */
    --font-ui: 'W95FA', 'IBM VGA Cyrillic', 'MS Sans Serif 8pt', monospace;
    --font-text: 'W95FA', 'IBM VGA Cyrillic', 'MS Sans Serif 8pt', monospace;
    --font-mono: 'Fixedsys', 'IBM VGA Cyrillic', 'Courier New', monospace;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Force pixel-perfect rendering - NO antialiasing */
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
    text-rendering: optimizeSpeed;
}

body {
    font-family: var(--font-ui);
    font-size: 11px; /* CRITICAL: Exact bitmap size */
    background: var(--win-desktop);
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,.02) 2px,
            rgba(0,0,0,.02) 4px
        );
    color: var(--text-primary);
    line-height: 1.2;
    min-height: 100vh;
    /* Для iOS с вырезом (safe area) */
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    overflow-y: auto;
    /* CRITICAL: Disable ALL antialiasing */
    -webkit-font-smoothing: none !important;
        align-items: flex-end !important;
    }

    /* Уменьшаем нижний отступ у элементов внутри taskbar */
    .win95-taskbar > * {
        margin-bottom: 0 !important;
    }
    .win95-task-buttons, .win95-tray, .win95-start-button {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-smooth: never !important;
    text-rendering: optimizeSpeed !important;
    image-rendering: pixelated !important;
    image-rendering: -moz-crisp-edges !important;
    image-rendering: crisp-edges !important;
    position: relative;
    /* Force pixel grid alignment */
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Запретить выделение текста по умолчанию */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile wrapper - невидим, используется только на мобильных */
.mobile-wrapper {
    display: contents;
}

/* Desktop Icons Container */
.desktop-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 20px;
    padding: 20px;
    padding-bottom: 60px; /* Отступ для панели задач */
    max-width: 100%;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border: 2px solid transparent;
    user-select: none;
}

.desktop-icon:hover {
    background: rgba(0, 0, 128, 0.1);
    border: 2px dotted var(--text-white);
}

.desktop-icon.selected {
    background: rgba(0, 0, 128, 0.3);
    border: 2px dotted var(--text-white);
}

.desktop-icon-image {
    font-size: 32px;
    margin-bottom: 4px;
    filter: drop-shadow(1px 1px 0px rgba(0,0,0,0.4));
}

.desktop-icon-label {
    color: var(--text-white);
    font-family: var(--font-ui);
    font-size: 11px; /* Bitmap size */
    font-weight: normal;
    text-shadow: 
        1px 1px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000;
    word-wrap: break-word;
}

/* ==================== WINDOWS 95 WINDOW ==================== */
.win95-window {
    position: fixed;
    background: var(--win-gray);
    border: 2px solid;
    border-color: var(--btn-light) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-light);
    box-shadow: 
        inset 1px 1px 0 var(--btn-highlight),
        inset -1px -1px 0 var(--btn-shadow),
        2px 2px 10px rgba(0,0,0,0.4);
    z-index: 100;
    display: none;
    min-width: 300px;
}

.win95-window.active {
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.win95-window.minimized {
    display: none !important;
}

/* Maximized window state */
.win95-window.maximized {
    width: 100% !important;
    height: calc(100vh - 48px) !important;
    left: 0 !important;
    top: 0 !important;
    max-width: 100% !important;
    max-height: calc(100vh - 48px) !important;
    transform: none !important;
    margin: 0 !important;
}

.win95-window.maximized .win95-content {
    max-height: calc(100vh - 100px) !important;
    height: calc(100vh - 100px) !important;
    overflow-y: auto !important;
}

/* Window Title Bar */
.win95-title-bar {
    background: linear-gradient(to right, #000080, #1084d0);
    color: white;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
}

.win95-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
    font-size: 11px; /* Bitmap size */
    padding: 2px 4px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.win95-title-icon {
    font-size: 14px;
}

.win95-title-buttons {
    display: flex;
    gap: 2px;
}

.win95-title-button {
    width: 18px;
    height: 16px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: #000000;
    font-family: "MS Sans Serif", sans-serif;
}

.win95-title-button:hover {
    background: #dfdfdf;
    border-color: #ffffff #606060 #606060 #ffffff;
}

.win95-title-button:active {
    border-color: #808080 #ffffff #ffffff #808080;
    padding-left: 2px;
    padding-top: 2px;
    background: #a0a0a0;
}

.win95-title-button.minimize {
    font-size: 16px;
    font-weight: bold;
    padding-bottom: 4px;
}

.win95-title-button.maximize {
    font-size: 13px;
    font-weight: normal;
}

.win95-title-button.close {
    background: #c0c0c0;
    font-size: 16px;
    font-weight: bold;
    color: #000000;
}

/* Window Content */
.win95-content {
    flex: 1;
    overflow: auto;
    background: white;
    border: 2px solid;
    border-color: var(--btn-shadow) var(--btn-highlight) var(--btn-highlight) var(--btn-shadow);
    margin: 2px;
    display: flex;
    flex-direction: column;
    font-family: var(--font-text);
    font-size: 11px; /* Bitmap size */
    max-height: 500px; /* Ограничение высоты для десктопа - компактнее */
}

.win95-inner-content {
    padding: 16px;
    flex: 1;
    line-height: 1.5;
}

.win95-inner-content p {
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Privacy page content */
.privacy-content {
    max-height: 60vh;
    overflow-y: auto;
}

#window-privacy:not(.maximized) {
    max-width: 90%;
}

.win95-inner-content h1,
.win95-inner-content h2,
.win95-inner-content h3 {
    font-family: var(--font-ui);
    font-weight: bold;
    margin-bottom: 8px;
}

.win95-inner-content h1 {
    font-size: 14px; /* Larger bitmap size */
}

.win95-inner-content h2 {
    font-size: 12px;
}

.win95-inner-content h3 {
    font-size: 11px;
}

.win95-inner-content code,
.win95-inner-content pre {
    font-family: var(--font-mono);
    font-size: 11px;
}

/* Window Menu Bar */
.win95-menu-bar {
    background: var(--win-gray);
    border-bottom: 1px solid var(--btn-shadow);
    display: flex;
    gap: 8px;
    padding: 2px 4px;
    font-size: 11px;
}

.win95-menu-item {
    padding: 2px 8px;
    cursor: pointer;
}

.win95-menu-item:hover {
    background: var(--win-title-active);
    color: white;
}

/* ==================== TASKBAR ==================== */
.win95-taskbar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    background: var(--win-gray) !important;
    border-top: 2px solid var(--btn-highlight);
    display: flex !important;
    align-items: center;
    padding: 2px;
    /* Safe area для устройств с вырезом */
    padding-left: max(2px, env(safe-area-inset-left));
    padding-right: max(2px, env(safe-area-inset-right));
    padding-bottom: env(safe-area-inset-bottom);
    gap: 4px;
    z-index: 10000 !important;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.2);
    /* Гарантируем что панель всегда видна */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    visibility: visible !important;
    opacity: 1 !important;
    /* Для iOS Safari */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Фикс для мобильных браузеров */
    margin: 0 !important;
    pointer-events: auto !important;
}

/* Start Button */
.win95-start-button {
    height: 40px;
    padding: 0 8px;
    background: var(--btn-face);
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-ui);
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.win95-start-button:hover {
    background: var(--btn-light);
}

.win95-start-button:active,
.win95-start-button.active {
    border-color: var(--btn-dark-shadow) var(--btn-highlight) var(--btn-highlight) var(--btn-dark-shadow);
    padding-left: 10px;
    padding-top: 2px;
}

.win95-start-logo {
    width: 24px;
    height: 24px;
    font-size: 20px;
}

/* Task Buttons */
.win95-task-buttons {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    height: 40px;
    align-items: center;
}

.win95-task-button {
    min-width: 120px;
    max-width: 200px;
    height: 36px;
    background: var(--btn-face);
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.win95-task-button:hover {
    background: var(--btn-light);
}

.win95-task-button.active {
    border-color: var(--btn-dark-shadow) var(--btn-highlight) var(--btn-highlight) var(--btn-dark-shadow);
    background: var(--btn-shadow);
}

.win95-task-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* System Tray */
.win95-tray {
    height: 40px;
    border: 1px solid;
    border-color: var(--btn-shadow) var(--btn-highlight) var(--btn-highlight) var(--btn-shadow);
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    background: var(--win-gray);
}

.win95-clock {
    min-width: 60px;
    text-align: center;
}

/* ==================== START MENU ==================== */
.win95-start-menu {
    position: fixed;
    bottom: 40px;
    left: 2px;
    width: 250px;
    max-height: 300px; /* Фиксированная компактная высота */
    overflow-y: auto;
    background: var(--win-gray);
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    display: none;
    z-index: 9999;
}

.win95-start-menu.active {
    display: block;
}

.win95-start-sidebar {
    background: linear-gradient(to top, #000080, #1084d0);
    color: white;
    padding: 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: bold;
    font-size: 20px;
    float: left;
    height: 100%;
    letter-spacing: 2px;
}

.win95-start-items {
    padding: 4px 0;
}

.win95-start-item {
    padding: 8px 32px 8px 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    font-size: 11px;
}

.win95-start-item:hover {
    background: var(--win-title-active);
    color: white;
}

.win95-start-item-icon {
    position: absolute;
    left: 12px;
    font-size: 18px;
}

.win95-start-separator {
    height: 1px;
    background: var(--btn-shadow);
    margin: 4px 8px;
    border-bottom: 1px solid var(--btn-highlight);
}

/* ==================== BUTTONS ==================== */
.btn,
button,
input[type="submit"],
input[type="button"] {
    min-width: 75px;
    padding: 4px 12px;
    background: var(--btn-face);
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: normal;
    cursor: pointer;
    outline: none;
}

.btn:hover,
button:hover {
    background: var(--btn-light);
}

.btn:active,
button:active {
    border-color: var(--btn-dark-shadow) var(--btn-highlight) var(--btn-highlight) var(--btn-dark-shadow);
    padding-left: 13px;
    padding-top: 5px;
}

.btn:focus {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

.btn-primary {
    font-weight: bold;
}

/* ==================== FORM ELEMENTS ==================== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    padding: 4px;
    border: 2px solid;
    border-color: var(--btn-shadow) var(--btn-highlight) var(--btn-highlight) var(--btn-shadow);
    background: white;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

textarea {
    resize: none; /* Запретить изменение размера */
    overflow-y: auto; /* Скролл при переполнении */
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--btn-dark-shadow) var(--btn-light) var(--btn-light) var(--btn-dark-shadow);
}

.form-control {
    width: 100%;
    margin-bottom: 8px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px;
    margin-bottom: 16px;
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
    background: var(--win-gray);
}

.alert-success {
    background: #c0ffc0;
}

.alert-danger {
    background: #ffc0c0;
}

.alert-info {
    background: #c0c0ff;
}

.alert-warning {
    background: #ffffc0;
}

/* ==================== PROFILE & CONTENT ==================== */
.profile-section {
    background: white;
    border: 2px solid;
    border-color: var(--btn-shadow) var(--btn-highlight) var(--btn-highlight) var(--btn-shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.profile-img {
    border: 2px solid var(--btn-shadow);
    max-width: 150px;
}

.skill-badge {
    background: var(--btn-face);
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
    padding: 8px;
    text-align: center;
    font-size: 11px;
    margin-bottom: 8px;
}

/* ==================== TABLE ==================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 6px;
    text-align: left;
    border: 1px solid var(--btn-shadow);
    font-size: 11px;
}

th {
    background: var(--win-gray);
    font-weight: bold;
}

tr:nth-child(even) {
    background: #f0f0f0;
}

/* ==================== SCROLLBAR (Windows 95 Style) ==================== */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: var(--win-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--btn-face);
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
}

::-webkit-scrollbar-button {
    background: var(--btn-face);
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
    height: 16px;
    width: 16px;
}

::-webkit-scrollbar-button:vertical:decrement {
    background: var(--btn-face) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><polygon points="4,2 1,6 7,6" fill="black"/></svg>') center no-repeat;
}

::-webkit-scrollbar-button:vertical:increment {
    background: var(--btn-face) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><polygon points="4,6 1,2 7,2" fill="black"/></svg>') center no-repeat;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    body {
        position: fixed;
        width: 100%;
        height: 100vh;
        overflow: hidden;
    }
    
    .desktop-icons {
        grid-template-columns: repeat(auto-fill, 70px);
        grid-auto-rows: 60px;
        gap: 3px 5px;
        padding: 10px;
        padding-bottom: 60px;
        height: calc(100vh - 48px);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .desktop-icon {
        width: 70px;
        height: 60px;
        padding: 2px;
    }
    
    .desktop-icon-image {
        font-size: 24px;
        margin-bottom: 1px;
    }
    
    .desktop-icon-label {
        font-size: 9px;
        line-height: 1.1;
    }
    
    /* Размеры и позиции окон контролируются через JavaScript */
    
    .win95-content {
        overflow-y: auto !important;
    }
    
    /* Flash message alerts on mobile */
    .win95-window[id^="alert-"] {
        width: 85% !important;
        max-width: 85% !important;
        left: 7.5% !important;
        transform: none !important;
        top: 20% !important;
        max-height: 250px !important;
    }
    
    .win95-window[id^="alert-"] .win95-content {
        max-height: 180px !important;
        overflow-y: auto !important;
    }
    
    .win95-inner-content {
        padding: 8px !important;
    }
    
    .profile-section {
        padding: 8px !important;
        margin-bottom: 8px !important;
    }
    
    table {
        font-size: 11px;
    }
    
    table td, table th {
        padding: 4px !important;
    }
    
    .win95-start-button span {
        display: none;
    }
    
    .win95-task-button {
        min-width: 80px;
        max-width: 120px;
    }
    
    .win95-task-buttons {
        height: 36px;
    }
    
    .win95-start-menu {
        width: 200px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .win95-start-item {
        padding: 6px 24px 6px 32px;
        font-size: 10px;
    }
    
    .win95-start-item-icon {
        left: 8px;
        font-size: 14px;
    }
    
    .win95-tray {
        padding: 0 4px;
    }
}

@media (max-width: 480px) {
    body {
        position: fixed;
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
    }
    
    .mobile-wrapper {
        display: contents;
    }
    
    .desktop-icons {
        padding: 8px !important;
        padding-bottom: 60px !important;
        gap: 2px 4px !important;
        height: calc(100dvh - 48px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        grid-template-columns: repeat(auto-fill, 70px) !important;
        grid-auto-rows: 56px !important;
    }

    .win95-taskbar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 10000 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: calc(48px + max(env(safe-area-inset-bottom,0px), 24px)) !important;
        background: var(--win-gray);
        padding-bottom: max(env(safe-area-inset-bottom,0px), 0px) !important;
        /* iOS Safari force paint hack */
        will-change: transform;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        /* iOS Safari sometimes needs this to force repaint */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        /* Prevent pointer-events issues */
        pointer-events: auto !important;
    }
    
    .desktop-icon {
        width: 70px !important;
        height: 56px !important;
        padding: 1px !important;
    }
    
    .desktop-icon-image {
        font-size: 22px !important;
        margin-bottom: 1px !important;
    }
    
    .desktop-icon-label {
        font-size: 8px !important;
        line-height: 1.0 !important;
    }
    
    .win95-taskbar {
        height: 48px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        bottom: 0 !important;
        z-index: 10000 !important;
    }
    
    /* Размеры и позиции окон контролируются через JavaScript */
    
    .desktop-icons,
    .win95-window {
        margin-bottom: 0 !important;
    }
    
    .win95-content {
        overflow-y: auto !important;
        font-size: 11px;
        padding: 4px !important;
    }
    
    .win95-inner-content {
        padding: 4px !important;
    }
    
    /* Flash message alerts on small mobile */
    .win95-window[id^="alert-"] {
        width: 80% !important;
        max-width: 80% !important;
        left: 10% !important;
        transform: none !important;
        top: 25vh !important;
        max-height: 200px !important;
    }
    
    .win95-window[id^="alert-"] .win95-content {
        max-height: 140px !important;
        overflow-y: auto !important;
    }
    
    .win95-window[id^="alert-"] .win95-inner-content {
        font-size: 10px !important;
        padding: 6px !important;
    }
    
    .win95-title-bar {
        height: auto !important;
        min-height: 20px !important;
        flex-wrap: wrap;
    }
    
    .win95-title {
        font-size: 10px;
        padding: 0 4px;
        white-space: normal;
        word-wrap: break-word;
        flex: 1 1 auto;
        max-width: calc(100% - 60px);
    }
    
    .win95-title-buttons {
        flex-shrink: 0;
    }
    
    .win95-title-icon {
        font-size: 12px;
    }
    
    .win95-title-button {
        width: 16px;
        height: 14px;
        font-size: 10px;
    }
    
    /* Fix privacy window positioning on mobile */
    #window-privacy:not(.maximized) {
        left: 5% !important;
        margin-left: 0 !important;
        width: 90% !important;
        max-width: 90% !important;
    }
    
    #window-privacy:not(.maximized) .win95-content {
        max-height: 60vh !important;
    }
    
    .win95-start-button {
        height: 32px !important;
        padding: 0 4px;
        font-size: 11px;
    }
    
    .win95-task-button {
        height: 32px !important;
        min-width: 50px;
        font-size: 9px;
        padding: 0 4px;
    }
    
    .win95-task-buttons {
        height: 32px !important;
        align-items: center !important;
    }
    
    .win95-tray {
        height: 32px !important;
        font-size: 10px;
        display: flex !important;
        align-items: center !important;
    }
    
    .win95-start-menu {
        bottom: 36px;
        max-height: 60vh;
        width: 180px;
    }
    
    .win95-start-item {
        padding: 4px 16px 4px 28px;
        font-size: 9px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .win95-start-item-icon {
        left: 6px;
        font-size: 12px;
    }
    
    .win95-start-sidebar {
        font-size: 14px;
        padding: 4px;
    }
    
    .profile-section,
    .skill-badge {
        font-size: 10px;
        padding: 4px !important;
    }
    
    .profile-img {
        max-width: 80px !important;
    }
    
    table {
        font-size: 9px;
    }
    
    table td, table th {
        padding: 2px !important;
    }
    
    h1 {
        font-size: 16px !important;
    }
    
    h2 {
        font-size: 14px !important;
    }
    
    h3 {
        font-size: 12px !important;
    }
    
    /* Toggle title length on mobile */
    .win95-title .title-full {
        display: none;
    }
    
    .win95-title .title-short {
        display: inline !important;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.text-center { text-align: center; }
.text-bold { font-weight: bold; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.win95-window.active {
    animation: fadeIn 0.15s ease-out;
}

/* ==================== COMMENTS SECTION ==================== */
#comment-text {
    min-height: 80px;
    max-height: 150px;
    resize: none !important;
    width: 100%;
}

.comment-box {
    background: white;
    border: 2px solid;
    border-color: var(--btn-shadow) var(--btn-highlight) var(--btn-highlight) var(--btn-shadow);
    padding: 12px;
    margin-bottom: 12px;
}

.comment-author {
    font-weight: bold;
    color: var(--win-title-active);
    margin-bottom: 4px;
    /* Разрешить выделение имени пользователя */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.comment-date {
    color: var(--text-gray);
    font-size: 10px;
    margin-bottom: 8px;
}

.comment-text {
    font-size: 11px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    word-break: break-word;
    /* Разрешить выделение текста комментария */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* ==================== PROJECTS GRID ==================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.project-card {
    background: var(--win-gray);
    border: 2px solid;
    border-color: var(--btn-highlight) var(--btn-dark-shadow) var(--btn-dark-shadow) var(--btn-highlight);
    padding: 12px;
}

.project-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 12px;
}

.project-description {
    font-size: 11px;
    margin-bottom: 12px;
    min-height: 60px;
}

/* Hide old elements */
.navbar,
.container {
    display: none !important;
}
