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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.preview {
    text-align: center;
}

.canvas-container {
    margin: 20px auto;
    width: 500px;
    height: 500px;
    position: relative;
}

.canvas-container canvas {
    border-radius: 10px;
}

.upload-section {
    margin-top: 20px;
}

input[type="file"] {
    display: none;
}

.upload-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.upload-button:hover {
    background-color: #45a049;
}

#downloadBtn {
    padding: 10px 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}

#downloadBtn:hover {
    background-color: #1976D2;
}

/* Mobile Optimizations - Chỉ áp dụng cho màn hình mobile */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        padding: 10px;
        min-height: 100vh;
    }

    h1 {
        font-size: clamp(1.2rem, 4vw, 1.8rem);
        padding: 0 10px;
    }

    .canvas-container {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1;
    }

    .canvas-container canvas {
        width: 100% !important;
        height: 100% !important;
        position: absolute !important;
        top: 0;
        left: 0;
    }

    .controls {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
        padding: 10px;
    }

    .upload-button,
    #downloadBtn {
        padding: 15px 30px;
        font-size: 1.1rem;
        width: 100%;
        max-width: 200px;
        border-radius: 25px;
    }

    /* Prevent scrolling when dragging on mobile */
    .canvas-container.dragging {
        touch-action: none;
    }
}

.options {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.border-options {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
}

.image-container {
    position: relative;
    margin: 20px auto;
    text-align: center;
    width: 500px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#framePreview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    z-index: 3;
}

#previewImage {
    position: absolute;
    cursor: move;
    transform-origin: center;
    user-select: none;
    -webkit-user-select: none;
    width: calc(100% - 80px);
    height: calc(100% - 80px);
    object-fit: contain;
    z-index: 2;
}

.mobile-instructions {
    display: none;
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.mobile-instructions p {
    margin: 5px 0;
}

/* Only show instructions on mobile */
@media (max-width: 768px) {
    .mobile-instructions {
        display: block;
    }
}

#editBtn {
    padding: 10px 20px;
    background-color: #FF9800;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    font-size: 1rem;
}

#editBtn.editing {
    background-color: #4CAF50;
}

#editBtn:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    #editBtn {
        padding: 15px 30px;
        font-size: 1.1rem;
        width: 100%;
        max-width: 200px;
        border-radius: 25px;
    }
}

.drop-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    pointer-events: none;
}

.drop-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    font-size: 1.5rem;
    padding: 2rem;
    border: 3px dashed white;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.5);
}

.drop-message svg {
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

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

.dragging .drop-overlay {
    display: block;
}

/* Chỉ hiện drop zone trên desktop */
@media (max-width: 768px) {
    .drop-overlay {
        display: none !important;
    }
} 