/* static/css/family.css — ручка внутри дверцы, без выступов */

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

body, #root {
    width: 100%;
    background: #3a3a3a;
    overflow-x: hidden; /* страница не скроллится горизонтально */
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Segoe UI', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
    padding: 20px;
}

.fridge-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Панель управления */
.fridge-control-panel {
    width: 80%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    padding: 10px 30px;
    background: #2d2d2d;
    border-radius: 20px 20px 0 0;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.3), 0 5px 0 #1a1a1a;
    color: #ddd;
}

.control-brand {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 6px;
    color: #cfcfcf;
    text-shadow: 2px 2px 0 #1a1a1a;
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.panel-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #4a4a4a;
    border: 2px solid #888;
    color: #eee;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3), 0 4px 0 #1a1a1a;
    transition: 0.1s;
}

.panel-btn-icon:hover {
    background: #5a5a5a;
    transform: translateY(-2px);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3), 0 6px 0 #1a1a1a;
}

.panel-btn-icon:active {
    transform: translateY(3px);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3), 0 1px 0 #1a1a1a;
}

/* Щель */
.fridge-gap {
    width: 80%;
    max-width: 1200px;
    height: 8px;
    background: #222;
    box-shadow: inset 0 2px 3px #000;
    border-radius: 0 0 4px 4px;
    margin: 0 auto;
}

/* Дверца холодильника */
.fridge-door {
    width: 80%;
    max-width: 1200px;
    height: 400vh;
    margin: 0 auto;
    background: linear-gradient(145deg, #ececec, #cfcfcf);
    border-radius: 20px 20px 15px 15px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.15), 0 25px 30px rgba(0,0,0,0.3), 0 0 0 10px #b0b0b0;
    position: relative;
    padding: 25px 60px 25px 70px;
    border: 2px solid #aaa;
    overflow-y: auto;
    overflow-x: hidden; /* скрываем горизонтальную прокрутку */
}

/* Ручка холодильника — внутри дверцы, слева */
.fridge-handle {
    position: absolute;
    left: 0;
    top: 30%;
    width: 40px;
    height: 250px;
    background: linear-gradient(to right, #999, #ccc, #999);
    border-radius: 0 10px 10px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2), inset -1px 0 2px rgba(255,255,255,0.5);
    border-left: none;
    border-right: 1px solid #888;
    z-index: 20;
    pointer-events: none;
}

/* Боковые края дверцы (декоративные) */
.fridge-left-edge,
.fridge-right-edge {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    background: rgba(0,0,0,0.05);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
    z-index: 1;
}
.fridge-left-edge {
    left: -4px;
    border-radius: 20px 0 0 15px;
}
.fridge-right-edge {
    right: -4px;
    border-radius: 0 20px 15px 0;
}

/* Контейнер сетки */
.grid-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

/* Стикер-карточка */
.sticker-card {
    background: #fff9e6;
    border-radius: 8px 25px 8px 25px;
    box-shadow: 3px 5px 10px rgba(0,0,0,0.2), inset -1px -1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e0d6b0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    overflow: auto;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sticker-card:hover {
    transform: scale(1.02);
    box-shadow: 5px 8px 15px rgba(0,0,0,0.25);
    z-index: 25;
}

.sticker-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
    text-decoration: underline wavy #cd7f32;
    border-bottom: 2px dashed #cd7f32;
}

.sticker-content {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #3a3a3a;
    margin-bottom: 10px;
}

.sticker-load-btn {
    align-self: flex-start;
    background: #cd7f32;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 0 #8b5a2b;
    transition: 0.1s;
    font-family: inherit;
    font-size: 0.8rem;
}

.sticker-load-btn:hover {
    background: #b36b2a;
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #8b5a2b;
}

.sticker-details {
    margin-top: 8px;
    font-size: 0.8rem;
}

.sticker-gallery {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sticker-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid white;
    box-shadow: 1px 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
}

.loading-text, .error-message {
    text-align: center;
    margin: 20px;
    font-size: 1.2rem;
}

/* Адаптивность */
@media (max-width: 1100px) {
    .fridge-control-panel, .fridge-gap, .fridge-door {
        width: 90%;
    }
    .fridge-handle {
        width: 12px;
        height: 200px;
    }
    .fridge-door {
        padding-left: 55px;
        padding-right: 50px;
    }
}

@media (max-width: 700px) {
    .fridge-control-panel, .fridge-gap, .fridge-door {
        width: 95%;
    }
    .fridge-door {
        padding: 15px 40px 15px 50px;
    }
    .fridge-handle {
        width: 10px;
        height: 150px;
        top: 25%;
    }
    .control-brand {
        font-size: 1.5rem;
    }
    .panel-btn-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}