* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    color: white;
}

#effects-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0; 
    pointer-events: none; 
    overflow: hidden;
}

.top-panel {
    position: absolute;
    top: 15px; right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.top-panel button {
    background: rgba(0, 0, 0, 0.5); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    color: white;
    font-size: 20px; 
    width: 45px; 
    height: 45px; 
    border-radius: 12px;
    cursor: pointer; 
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}
.top-panel button:hover { 
    background: rgba(0, 0, 0, 0.8); 
    transform: scale(1.05);
}

#desktop-area {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; 
}

.desktop-icon {
    position: absolute;
    width: 80px; 
    text-align: center;
    cursor: pointer; 
    user-select: none;
    transition: transform 0.1s;
}
.desktop-icon:active {
    transform: scale(0.95);
}
.desktop-icon a {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.desktop-icon img {
    width: 60px; height: 60px; 
    border-radius: 14px;
    object-fit: cover; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    pointer-events: none; 
}
.desktop-icon span {
    display: block; 
    font-size: 13px; 
    margin-top: 6px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8), 0 0 5px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 8px;
    word-wrap: break-word;
    max-width: 100%;
}

/* --- ВИДЖЕТЫ (Glassmorphism) --- */
.widget {
    position: absolute;
    z-index: 2; 
    background: rgba(20, 20, 20, 0.55);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    color: white;
    cursor: grab;
    user-select: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: box-shadow 0.2s, transform 0.1s;
}
.widget:active {
    cursor: grabbing;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    transform: scale(0.98);
}

/* Часы */
.widget-clock {
    font-size: 38px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding: 20px 30px;
}
.widget-clock .date {
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-top: 5px;
    letter-spacing: normal;
}

/* Погода (Новый дизайн) */
.widget-weather {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 380px;
}

/* Верхняя часть погоды */
.weather-top {
    display: flex;
    align-items: center;
    gap: 15px;
}
.w-icon {
    font-size: 50px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    line-height: 1;
}
.w-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.w-temp {
    font-size: 42px;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.w-feels {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4px;
    white-space: nowrap;
}
.w-details {
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.w-city {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.w-highlow, .w-misc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

/* Нижняя часть (Прогноз) */
.weather-bottom {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.w-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}
.w-day:last-child {
    border-right: none;
}
.w-day-name {
    font-size: 13px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
}
.w-day-icon {
    font-size: 22px;
}
.w-day-temps {
    font-size: 13px;
    font-weight: bold;
}
.w-day-temps span {
    color: rgba(255, 255, 255, 0.6);
    font-weight: normal;
    margin-left: 3px;
}

/* --- КОНТЕКСТНЫЕ МЕНЮ --- */
.context-menu {
    display: none; 
    position: absolute;
    background: rgba(40, 40, 40, 0.95); 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 1000; 
    border-radius: 8px; 
    min-width: 180px;
    overflow: hidden;
}
.context-menu ul { list-style: none; }
.context-menu li { 
    padding: 12px 15px; 
    cursor: pointer; 
    font-size: 14px;
    transition: background 0.2s;
}
.context-menu li:hover { background: rgba(255,255,255,0.1); }
.context-menu li:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,0.05); }

/* --- МОДАЛЬНЫЕ ОКНА --- */
.modal {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); 
    backdrop-filter: blur(5px);
    z-index: 2000;
}
.modal-content {
    background: #23272a; 
    margin: 5vh auto; 
    padding: 25px;
    width: 90%; 
    max-width: 450px; 
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content h2 { margin-bottom: 15px; font-weight: 500; border-bottom: 1px solid #444; padding-bottom: 10px;}
.modal-content h3 { margin-top: 20px; font-size: 16px; color: #aaa; }
.close { float: right; font-size: 28px; cursor: pointer; color: #aaa; transition: color 0.2s;}
.close:hover { color: white; }

.modal-content label { display: block; margin-top: 15px; font-size: 14px; color: #ddd;}
.modal-content input[type="text"], 
.modal-content select {
    width: 100%; padding: 10px; margin-top: 5px;
    background: #2c2f33; border: 1px solid #444; 
    color: white; border-radius: 6px; outline: none;
}
.modal-content input[type="text"]:focus { border-color: #7289da; }

.modal-content button {
    background: #4f545c; border: none; color: white;
    padding: 8px 12px; border-radius: 5px; cursor: pointer;
    transition: background 0.2s;
}
.modal-content button:hover { background: #7289da; }

hr { margin: 20px 0; border: 0; border-top: 1px solid #444; }

.save-btn {
    width: 100%; padding: 12px !important; 
    background: #43b581 !important; color: white;
    font-size: 16px; font-weight: bold; margin-top: 10px;
}
.save-btn:hover { background: #3ca374 !important; }

/* Галерея */
.grid { 
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; 
}
.grid img { 
    width: 80px; height: 80px; object-fit: cover; 
    cursor: pointer; border: 2px solid transparent; border-radius: 8px;
    transition: transform 0.2s, border-color 0.2s;
}
.grid img:hover { border-color: #7289da; transform: scale(1.05); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #23272a; }
::-webkit-scrollbar-thumb { background: #4f545c; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #7289da; }