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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.main-content {
    padding-bottom: 7rem;
}

.navbar {
    background: #1a1a1a;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #00d4aa;
}

.page-header {
    text-align: center;
    padding: 2rem;
    color: white;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-desc {
    font-size: 1.2rem;
    opacity: 0.9;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.tool-wrapper {
    background: white;
    border-radius: 30px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.upload-section {
    margin-bottom: 2.5rem;
}

.upload-box {
    border: 3px dashed #667eea;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(102, 126, 234, 0.05);
}

.upload-box:hover,
.upload-box.dragover {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.1);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: #666;
    font-size: 0.95rem;
}

#imageInput {
    display: none;
}

.preview-section {
    margin-bottom: 2.5rem;
    display: none;
}

.preview-section.active {
    display: block;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.preview-box {
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 1.5rem;
    background: #f8f9fa;
}

.preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.preview-image-wrapper {
    max-height: 400px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#previewImage, #resizeCanvas, #canvas {
    max-width: 100%;
    border-radius: 10px;
}

.effects-section {
    margin-bottom: 2.5rem;
    display: none;
}

.effects-section.active {
    display: block;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.category-tab {
    padding: 0.7rem 1.3rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.category-tab:hover {
    border-color: #764ba2;
    color: #764ba2;
    transform: translateY(-2px);
}

.category-tab.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.effect-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.effect-tab {
    padding: 0.6rem 1.1rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.effect-tab:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.effect-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.effect-settings {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.8rem;
}

.setting-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    transition: transform 0.2s;
}

.setting-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.setting-value {
    display: inline-block;
    margin-top: 0.5rem;
    color: #667eea;
    font-weight: 600;
    font-size: 0.95rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.info-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-section p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.footer {
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 2rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
}

.footer p {
    font-size: 1.1rem;
}

.footer a {
    color: #00d4aa;
    text-decoration: none;
}

.progress-info {
    text-align: center;
    margin-top: 1rem;
    color: #667eea;
    font-weight: 500;
    display: none;
}

.progress-info.active {
    display: block;
}

#downloadInfo {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f0f4ff;
    border-radius: 12px;
}

#downloadInfo h4 {
    color: #667eea;
    margin-bottom: 0.8rem;
}

#downloadInfo p {
    color: #333;
    margin: 0.4rem 0;
    font-size: 0.95rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.modal-body h3 {
    color: #333;
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body h4 {
    color: #667eea;
    font-size: 1.1rem;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
}

.modal-body p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.modal-body ul {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-body strong {
    color: #333;
}

.cookies-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookies-banner.active {
    transform: translateY(0);
}

.cookies-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cookies-icon {
    font-size: 3rem;
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

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

.cookies-text {
    flex: 1;
    color: white;
}

.cookies-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #00d4aa;
}

.cookies-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
}

.cookies-text a {
    color: #00d4aa;
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.2s;
}

.cookies-text a:hover {
    opacity: 0.8;
}

.cookies-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.cookies-btn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookies-btn-decline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookies-btn-decline:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.cookies-btn-accept {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

.cookies-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.6);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1.2rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .cookies-content {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem 1.5rem;
        gap: 1rem;
    }
    
    .cookies-icon {
        font-size: 2.5rem;
    }
    
    .cookies-text h3 {
        font-size: 1.1rem;
    }
    
    .cookies-text p {
        font-size: 0.9rem;
    }
    
    .cookies-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .cookies-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }

    .category-tabs {
        gap: 0.5rem;
    }

    .category-tab {
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
    }

    .effect-tabs {
        gap: 0.4rem;
    }

    .effect-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1.2rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
}
