* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f1f3f6;
    color: #333;
    padding: 15px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #222;
}

.upload-zone {
    border: 2px dashed #007bff;
    padding: 25px 15px;
    border-radius: 8px;
    text-align: center;
    background: #f8faff;
    margin-bottom: 20px;
    position: relative;
}

.upload-zone input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-btn, .btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: block;
}

.upload-btn {
    background: #007bff;
    color: white;
    margin-top: 10px;
}

.btn-save {
    background: #28a745;
    color: white;
    margin-top: 10px;
}

.btn-rotate {
    background: #ffc107;
    color: #212529;
    margin-top: 10px;
}

.page-block {
    border: 1px solid #e1e6ed;
    padding: 15px;
    margin-top: 20px;
    border-radius: 10px;
    background: #fff;
    transition: all 0.3s ease;
}

.img-container {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}

img {
    max-width: 100%;
    height: auto;
    max-height: 350px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

select {
    width: 100%;
    padding: 12px;
    margin: 5px 0 15px 0;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    background: #fff;
}

label {
    font-size: 0.9rem;
    color: #666;
    font-weight: bold;
}

#loading {
    display: none;
    text-align: center;
    color: #007bff;
    font-weight: bold;
    margin: 15px 0;
}

.success-notice {
    padding: 20px;
    text-align: center;
    color: #28a745;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Модальное окно для полноэкранного превью */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

/* Стилизация уменьшенного превью, чтобы было понятно, что на него можно кликнуть */
.img-container img {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.img-container img:hover {
    opacity: 0.9;
}

.btn-delete {
    background: #dc3545;
    color: white;
    margin-top: 10px;
}

.btn-delete:hover {
    background: #bd2130;
}
