/* Meme Maker Specific Styles */
.meme-maker-container {
    min-height: 100vh;
    background: #808080;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.mobile-back-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
}

.mobile-back-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    color: white;
    text-decoration: none;
}

.meme-header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 0;
}

.meme-title {
    font-family: 'Anton', sans-serif;
    font-size: 3rem;
    color: white;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 15px;
    max-width: 100%;
    width: fit-content;
}

.back-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: inline-block;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    color: white;
    text-decoration: none;
}

.upload-btn, .add-nose-btn, .download-btn, .clear-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 140px;
    white-space: nowrap;
}

.upload-btn:hover, .add-nose-btn:hover, .download-btn:hover, .clear-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.canvas-container {
    position: relative;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 300px;
    height: 200px;
    display: block;
    padding: 0;
}

.drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: 3px dashed #ccc;
    border-radius: 15px;
    transition: all 0.3s ease;
    z-index: 10;
    cursor: pointer;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.drop-zone.hidden {
    display: none;
}

.drop-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    font-weight: bold;
}

.drop-text p {
    margin: 4px 0;
}

#konvaContainer {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    touch-action: none; /* Prevent default touch behaviors */
    -webkit-touch-callout: none; /* Disable callout on iOS */
    -webkit-user-select: none; /* Disable text selection */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .meme-maker-container {
        padding: 5px;
    }
    
    .meme-header {
        margin-top: 50px;
        margin-bottom: 15px;
    }
    
    .meme-title {
        font-size: 2rem;
    }
    
    .controls {
        gap: 12px;
        max-width: 100%;
        padding: 10px;
        margin: 0 auto;
        justify-content: center;
        width: fit-content;
    }
    
    .desktop-back-btn {
        display: none;
    }
    
    .upload-btn, .add-nose-btn, .download-btn, .clear-btn {
        padding: 10px 24px;
        font-size: 13px;
        flex: 1;
        min-width: 120px;
        max-width: calc(50% - 6px);
        white-space: nowrap;
    }
    
    .drop-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .meme-maker-container {
        padding: 5px;
    }
    
    .meme-header {
        margin-top: 20px;
        margin-bottom: 15px;
    }
    
    .meme-title {
        font-size: 1.5rem;
    }
    
    .controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        max-width: 100%;
        padding: 10px;
        margin: 0 auto;
        width: fit-content;
        justify-items: center;
    }
    
    .desktop-back-btn {
        display: none;
    }
    
    .upload-btn, .add-nose-btn, .download-btn, .clear-btn {
        padding: 10px 20px;
        font-size: 12px;
        width: 100%;
        min-width: 100px;
        white-space: nowrap;
    }
}
