body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e0f2e9 100%);
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 145, 110, 0.12);
}

h1 {
    text-align: center;
    color: #00916e;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    color: #2d3436;
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3rem;
}

h3 {
    color: #2d3436;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Header */
.site-header {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    border-radius: 12px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: #00916e;
    text-decoration: none;
}

.logo-icon {
    vertical-align: middle;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: #636e72;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover {
    color: #00916e;
    background: #e0f2e9;
}

.nav-link[data-active="true"] {
    color: white;
    background: linear-gradient(135deg, #00916e, #00a8a3);
}

/* Format Description */
.format-description {
    text-align: center;
    color: #636e72;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

/* Format Grid */
.format-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.format-card {
    background: white;
    padding: 24px 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e8f5e9;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.format-card:hover {
    border-color: #00916e;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 145, 110, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #e0f2e9 100%);
}

.format-card h3 {
    color: #2d3436;
    margin: 12px 0 8px 0;
    font-size: 1.1rem;
}

.format-card p {
    color: #636e72;
    font-size: 0.9rem;
    margin: 0;
}

/* Upload Section */
.upload-section {
    text-align: center;
    padding: 60px 40px;
    border: 3px dashed #00916e;
    border-radius: 16px;
    margin: 30px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e0f2e9 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-section:hover,
.upload-section.drag-over {
    border-color: #00a8a3;
    background: linear-gradient(135deg, #e0f2e9 0%, #d0ebe0 100%);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-section p {
    color: #2d3436;
    font-size: 1.2rem;
    margin: 10px 0;
}

.upload-hint {
    font-size: 0.95rem !important;
    color: #636e72 !important;
}

.upload-button {
    background: linear-gradient(135deg, #00916e, #00a8a3);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 145, 110, 0.3);
    margin-top: 20px;
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 145, 110, 0.4);
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 40px 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.features.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
}

.feature-card {
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa, #e0f2e9);
    border-radius: 12px;
    border-left: 4px solid #00916e;
}

.feature-card h3 {
    color: #2d3436;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.feature-card p {
    color: #636e72;
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

/* Image Grid */
.image-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.image-grid:not(:empty) {
    display: grid;
}

.image-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    aspect-ratio: 16/9;
    cursor: pointer;
}

.image-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 145, 110, 0.15);
}

.image-container.selected {
    border-color: #00916e;
}

.image-container::before {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    opacity: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.7);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-container:hover::before {
    opacity: 1;
}

.image-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    z-index: 2;
    cursor: pointer;
    accent-color: #00916e;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.4) 20%, rgba(0, 0, 0, 0.8));
    color: white;
    font-size: 12px;
    line-height: 1.4;
}

.size-info {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    opacity: 0.9;
}

.current-size,
.predicted-size {
    display: inline-block;
}

.predicted-size {
    color: #8eff9d;
    font-weight: 500;
}

.converted-size {
    color: #8eff9d;
    font-weight: 500;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    opacity: 0.8;
    transition: all 0.2s ease;
    z-index: 3;
}

.remove-btn:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.1);
}

/* Controls Section */
.controls-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.quality-slider {
    background: linear-gradient(135deg, #f8f9fa, #e0f2e9);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #00916e;
    display: flex;
    align-items: center;
    gap: 15px;
}

.quality-slider span:first-child {
    font-weight: 600;
    color: #2d3436;
    white-space: nowrap;
}

.quality-slider input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #00916e 0%, #00a8a3 100%);
    outline: none;
    -webkit-appearance: none;
}

.quality-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #00916e;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 145, 110, 0.3);
}

.quality-slider input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #00916e;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 145, 110, 0.3);
}

#quality-value {
    font-weight: 700;
    color: #00916e;
    font-size: 1.1rem;
    min-width: 50px;
    text-align: right;
}

.control-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.action-button {
    background: linear-gradient(135deg, #00916e, #00a8a3);
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 145, 110, 0.3);
    flex: 1;
}

.action-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 145, 110, 0.4);
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #6c757d;
}

.reset-button {
    background: linear-gradient(135deg, #636e72, #2d3436);
}

.reset-button:hover {
    box-shadow: 0 6px 16px rgba(99, 110, 114, 0.5);
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.show {
    opacity: 1;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: transparent;
}

#modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.close-modal {
    position: absolute;
    top: -30px;
    right: -30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #bbb;
}

.modal-info {
    margin-top: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
}

.modal-separator {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 300px;
}

.notification {
    background: #fff;
    border-left: 4px solid #00916e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    border-left-color: #00916e;
}

.notification.error {
    border-left-color: #dc3545;
}

.notification.fade-out {
    animation: slideOut 0.3s ease-in;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 30px 20px;
    background: white;
    border-radius: 12px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: #636e72;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #00916e;
}

.footer-copyright {
    color: #b2bec3;
    font-size: 0.85rem;
}

/* SEO Text */
.seo-text {
    margin-top: 60px;
    color: #6c757d;
}

.faq-section {
    margin-top: 40px;
}

details {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #e8f5e9;
    border-radius: 8px;
    background: #f8f9fa;
}

summary {
    cursor: pointer;
    font-weight: bold;
    color: #2d3436;
    padding: 8px;
}

details[open] summary {
    margin-bottom: 10px;
    color: #00916e;
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .upload-section {
        padding: 40px 20px;
    }
    
    .format-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .action-button {
        font-size: 1rem;
        padding: 14px 24px;
    }
    
    .header-content,
    .main-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .image-modal {
        display: none !important;
    }
    
    .image-container {
        cursor: default;
    }
    
    .quality-slider {
        flex-direction: column;
        align-items: stretch;
    }
    
    #quality-value {
        text-align: center;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .format-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Скрытие элементов при загрузке фото */
.format-grid.hidden,
.format-description.hidden,
.seo-text.hidden {
    display: none !important;
}
