* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.brand-info h1 {
    margin: 0;
    font-size: 1.8em;
    background: linear-gradient(45deg, #1b5e20, #2e7d32);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    text-align: center;
    text-shadow: none;
}

.brand-subtitle {
    margin: 5px 0 0 0;
    font-size: 1em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-description {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(27, 94, 32, 0.3);
}

.event-description h2 {
    margin: 0 0 15px 0;
    font-size: 1.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.description-text {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.call-to-action {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-text {
    margin: 0;
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #007bff;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #0056b3;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #28a745;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    transform: scale(1.02);
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.upload-text {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
    font-weight: 500;
}

.upload-button {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: auto;
}

.upload-button:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}



.upload-preview {
    max-width: 250px;
    max-height: 250px;
    margin: 20px auto 0;
    border: 2px solid #eee;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.upload-preview p {
    color: #888;
    font-style: italic;
    padding: 20px;
}

.canvas-section {
    text-align: center;
    margin-bottom: 30px;
}

.canvas-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

#canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: #f0f0f0;
    cursor: grab;
}

#canvas:active {
    cursor: grabbing;
}

.zoom-section {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.zoom-section h4 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
    font-size: 1.1em;
}

.zoom-slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.zoom-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-slider {
    flex: 1;
    max-width: 300px;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.zoom-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #007bff, #0056b3);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.4);
}

.zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #007bff, #0056b3);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.zoom-btn:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.4);
}

.zoom-level {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    min-width: 80px;
    text-align: center;
    background: white;
    padding: 8px 12px;
    border-radius: 20px;
    border: 2px solid #007bff;
}

.fit-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(45deg, #28a745, #218838);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.fit-btn:hover {
    background: linear-gradient(45deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.4);
}

.controls {
    text-align: center;
    margin-bottom: 30px;
}

button {
    padding: 12px 25px;
    margin: 0 10px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#resetBtn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a6f);
    color: white;
}

#resetBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

#downloadBtn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

#downloadBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

#downloadBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #007bff;
}

.instructions ol {
    margin-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 5px;
    }
    
    .header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .brand-info h1 {
        font-size: 1.4em;
    }
    
    .brand-subtitle {
        font-size: 0.9em;
    }
    
    .event-description {
        padding: 15px;
    }
    
    .event-description h2 {
        font-size: 1.3em;
    }
    
    .description-text {
        font-size: 1em;
    }
    
    .cta-text {
        font-size: 1em;
    }
    
    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 3em;
    }
    
    .upload-text {
        font-size: 1em;
        margin-bottom: 15px;
    }
    
    .upload-button {
        padding: 15px 25px;
        font-size: 14px;
        margin-top: 10px;
    }
    
    .upload-preview {
        max-width: 200px;
        max-height: 200px;
    }
    
    .canvas-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    #canvas {
        border-radius: 0;
    }
    
    .zoom-slider-container {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 10px;
        justify-content: center;
        align-items: center;
    }
    
    .zoom-controls-row {
        display: contents;
    }
    
    .zoom-slider {
        flex: 1;
        max-width: 150px;
        margin: 0 8px;
        order: 0;
    }
    
    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
        flex-shrink: 0;
    }
    
    .zoom-level {
        font-size: 14px;
        padding: 6px 8px;
        min-width: 80px;
        flex-shrink: 0;
    }
    
    .fit-btn {
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    button {
        display: block;
        width: 100%;
        margin: 10px 0;
        padding: 15px;
        font-size: 16px;
    }
    
    .controls {
        display: flex;
        gap: 10px;
    }
    
    .controls button {
        flex: 1;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
        margin: 0;
        border-radius: 0;
    }
    
    .header {
        padding: 15px 10px;
        margin-bottom: 15px;
        border-radius: 10px;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
    
    .brand-info h1 {
        font-size: 1.2em;
    }
    
    .brand-subtitle {
        font-size: 0.8em;
    }
    
    .event-description {
        padding: 12px;
    }
    
    .event-description h2 {
        font-size: 1.1em;
    }
    
    .description-text {
        font-size: 0.9em;
    }
    
    .call-to-action {
        padding: 10px;
    }
    
    .cta-text {
        font-size: 0.9em;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .upload-area {
        padding: 20px 10px;
    }
    
    .upload-icon {
        font-size: 2.5em;
    }
    
    .zoom-slider-container {
        gap: 6px;
        padding: 8px;
        flex-wrap: wrap;
    }
    
    .zoom-controls-row {
        display: contents;
    }
    
    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .zoom-level {
        font-size: 12px;
        padding: 5px 6px;
        min-width: 80px;
    }
    
    .zoom-slider {
        flex: 1;
        max-width: 120px;
        margin: 0 6px;
    }
    
    .fit-btn {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
}

/* Modal thông báo tải ảnh thành công */
.download-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.download-success-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.success-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.download-success-content h3 {
    color: #1b5e20;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.download-success-content p {
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.instruction {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    padding: 12px;
    border-radius: 8px;
    color: #1b5e20 !important;
    font-weight: bold;
    border: 2px solid #4caf50;
}

.success-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.success-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.success-btn.primary {
    background: linear-gradient(45deg, #1b5e20, #2e7d32);
    color: white;
}

.success-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(27, 94, 32, 0.4);
}

.success-btn.secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
}

.success-btn.secondary:hover {
    background: #eeeeee;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .download-success-content {
        margin: 15px;
        padding: 20px;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .success-btn {
        width: 100%;
    }
}
